From 64088f5221dcc5a87031e1be3ebc14e85b9e5e22 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 26 May 2021 17:04:29 -0700 Subject: [PATCH 01/59] helm chart configurable log verbosity --- charts/aws-ebs-csi-driver/templates/controller.yaml | 2 +- charts/aws-ebs-csi-driver/templates/node.yaml | 2 +- charts/aws-ebs-csi-driver/values.yaml | 3 ++- hack/values.yaml | 7 ++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index cde886f318..3f4624328b 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -74,7 +74,7 @@ spec: - --http-endpoint={{ . }} {{- end }} - --logtostderr - - --v=2 + - --v={{ .Values.controller.logLevel }} env: - name: CSI_ENDPOINT value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index 5ecb93059a..9ee0c45948 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -62,7 +62,7 @@ spec: - --volume-attach-limit={{ . }} {{- end }} - --logtostderr - - --v=2 + - --v={{ .Values.node.logLevel }} env: - name: CSI_ENDPOINT value: unix:/csi/csi.sock diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index a6cac89fb1..0f4e0d46fb 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -78,6 +78,7 @@ controller: httpEndpoint: # ID of the Kubernetes cluster used for tagging provisioned EBS volumes (optional). k8sTagClusterId: + logLevel: 2 nodeSelector: {} podAnnotations: {} priorityClassName: @@ -121,7 +122,6 @@ controller: # whenUnsatisfiable: ScheduleAnyway topologySpreadConstraints: [] - # Moving to values under node # The "maximum number of attachable volumes" per node volumeAttachLimit: @@ -131,6 +131,7 @@ node: ebsPlugin: [] nodeDriverRegistrar: [] kubeletPath: /var/lib/kubelet + logLevel: 2 priorityClassName: nodeSelector: {} podAnnotations: {} diff --git a/hack/values.yaml b/hack/values.yaml index 0ff3e8cc91..6d331b8acf 100644 --- a/hack/values.yaml +++ b/hack/values.yaml @@ -1 +1,6 @@ -enableVolumeSnapshot: true \ No newline at end of file +enableVolumeSnapshot: true +controller: + logLevel: 5 +node: + logLevel: 5 + From ffaac3fc938667c75faf7a55bd57c1e371de4f6f Mon Sep 17 00:00:00 2001 From: Varun Dhananjaya Date: Wed, 2 Jun 2021 19:26:20 -0700 Subject: [PATCH 02/59] release v1.1.0 --- CHANGELOG-0.x.md | 28 +++++++++++++++++++ charts/aws-ebs-csi-driver/Chart.yaml | 2 +- charts/aws-ebs-csi-driver/values.yaml | 2 +- .../overlays/stable/kustomization.yaml | 2 +- docs/README.md | 3 ++ 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/CHANGELOG-0.x.md b/CHANGELOG-0.x.md index efbb686385..8b209f3a20 100644 --- a/CHANGELOG-0.x.md +++ b/CHANGELOG-0.x.md @@ -1,3 +1,31 @@ +# v1.1.0 + +## Notable changes +- Helm chart cleaned up ([#856](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/856), [@krmichel](https://github.com/krmichel)) + +### New features +* Add podAnnotations to snapshotController StatefulSet ([#884](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/884), [@snstanton](https://github.com/snstanton)) +* Support custom pod labels in Helm chart ([#905](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/905), [@eytanhanig](https://github.com/eytanhanig)) + +### Bug fixes +* fix naming mistake in clusterrolebinding, expose env var to controller via downward api ([#874](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/874), [@vdhanan](https://github.com/vdhanan)) +* Fix kustomize RBAC bindings to have namespace kube-system ([#878](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/878), [@wongma7](https://github.com/wongma7)) +* rename node clusterrolebinding to make auto upgrade work ([#894](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/894), [@vdhanan](https://github.com/vdhanan)) +* remove hardcoded namespace for pod disruption budget ([#895](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/895), [@vdhanan](https://github.com/vdhanan)) +* Only initialize the in-cluster kube client when metadata service is actually unavailable ([#897](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/897), [@chrisayoub](https://github.com/chrisayoub)) +* Reduce default log level to 2 ([#903](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/903), [@wongma7](https://github.com/wongma7)) +* Add pod disruption budgets that got missed in a rebase ([#906](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/906), [@krmichel](https://github.com/krmichel)) +* remove WellKnownTopologyKey from PV Topology ([#912](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/912), [@Elbehery](https://github.com/Elbehery)) +* Skip volume expansion if block node ([#916](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/916), [@gnufied](https://github.com/gnufied)) + +### Misc. +* Add eksctl support to e2e scripts ([#852](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/852), [@wongma7](https://github.com/wongma7)) +* release v1.0.0 ([#865](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/865), [@vdhanan](https://github.com/vdhanan)) +* add self as owner ([#866](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/866), [@vdhanan](https://github.com/vdhanan)) +* bump helm chart version ([#881](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/881), [@vdhanan](https://github.com/vdhanan)) +* add custom useragent suffix ([#910](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/910), [@vdhanan](https://github.com/vdhanan)) +* Bump chart-releaser-action to v1.2.1 ([#914](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/914), [@gliptak](https://github.com/gliptak)) + # v1.0.0 ## Notable changes - With this release, the EBS CSI Driver is now Generally Available! diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index 5897f3ba77..8bebbc9943 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "1.0.0" +appVersion: "1.1.0" name: aws-ebs-csi-driver description: A Helm chart for AWS EBS CSI Driver version: 1.2.0 diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 6ca9a9cff8..5a9e6e2138 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -4,7 +4,7 @@ image: repository: k8s.gcr.io/provider-aws/aws-ebs-csi-driver - tag: "v1.0.0" + tag: "v1.1.0" pullPolicy: IfNotPresent sidecars: diff --git a/deploy/kubernetes/overlays/stable/kustomization.yaml b/deploy/kubernetes/overlays/stable/kustomization.yaml index c42cdc388d..36f0134e75 100644 --- a/deploy/kubernetes/overlays/stable/kustomization.yaml +++ b/deploy/kubernetes/overlays/stable/kustomization.yaml @@ -4,7 +4,7 @@ bases: - ../../base images: - name: k8s.gcr.io/provider-aws/aws-ebs-csi-driver - newTag: v1.0.0 + newTag: v1.1.0 - name: k8s.gcr.io/sig-storage/csi-provisioner newTag: v2.1.1 - name: k8s.gcr.io/sig-storage/csi-attacher diff --git a/docs/README.md b/docs/README.md index 42dbcf4d0c..5ef60d1814 100644 --- a/docs/README.md +++ b/docs/README.md @@ -12,6 +12,7 @@ The [Amazon Elastic Block Store](https://aws.amazon.com/ebs/) Container Storage | AWS EBS CSI Driver \ CSI Version | v0.3.0| v1.0.0 | v1.1.0 | |----------------------------------------|-------|--------|--------| | master branch | no | no | yes | +| v1.1.0 | no | no | yes | | v1.0.0 | no | no | yes | | v0.10.x | no | no | yes | | v0.9.x | no | no | yes | @@ -77,6 +78,7 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll | AWS EBS CSI Driver \ Kubernetes Version| v1.12 | v1.13 | v1.14 | v1.15 | v1.16 | v1.17 | v1.18+ | |----------------------------------------|-------|-------|-------|-------|-------|-------|-------| | master branch | no | no+ | no | no | no | yes | yes | +| v1.1.0 | no | no+ | no | no | no | yes | yes | | v1.0.0 | no | no+ | no | no | no | yes | yes | | v0.10.x | no | no+ | no | no | no | yes | yes | | v0.9.x | no | no+ | no | no | no | yes | yes | @@ -95,6 +97,7 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll |AWS EBS CSI Driver Version | Image | |---------------------------|--------------------------------------------------| |master branch |amazon/aws-ebs-csi-driver:latest | +|v1.1.0 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.0 | |v1.0.0 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.0.0 | |v0.10.1 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v0.10.1| |v0.10.0 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v0.10.0| From a1c2b72d3de85e8c0458ae89b7cb35495d0b328d Mon Sep 17 00:00:00 2001 From: Varun Dhananjaya Date: Fri, 4 Jun 2021 10:22:40 -0700 Subject: [PATCH 03/59] bump patch version in helm chart to trigger release --- charts/aws-ebs-csi-driver/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index 8bebbc9943..8d3d6e8e76 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.1.0" name: aws-ebs-csi-driver description: A Helm chart for AWS EBS CSI Driver -version: 1.2.0 +version: 1.2.1 kubeVersion: ">=1.17.0-0" home: https://github.com/kubernetes-sigs/aws-ebs-csi-driver sources: From 9404623248f0d7b9ab956ab40103cfee4838f1d2 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 4 Jun 2021 10:50:30 -0700 Subject: [PATCH 04/59] Update driver capabilities --- tests/e2e-kubernetes/manifests.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/e2e-kubernetes/manifests.yaml b/tests/e2e-kubernetes/manifests.yaml index e6d302be64..cdee83b1fe 100644 --- a/tests/e2e-kubernetes/manifests.yaml +++ b/tests/e2e-kubernetes/manifests.yaml @@ -22,8 +22,10 @@ DriverInfo: fsGroup: true block: true exec: true - volumeLimits: false - controllerExpansion: true - nodeExpansion: true snapshotDataSource: true + pvcDataSource: false multipods: true + controllerExpansion: true + nodeExpansion: true + volumeLimits: true + topology: true From b7876b7fd0ddda15a6848aa570515ff339887a70 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 4 Jun 2021 10:53:55 -0700 Subject: [PATCH 05/59] Create nodes in all zones to exercise more topology tests --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 61a014d411..db65078bc2 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ test-e2e-multi-az: .PHONY: test-e2e-migration test-e2e-migration: AWS_REGION=us-west-2 \ - AWS_AVAILABILITY_ZONES=us-west-2a \ + AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \ TEST_PATH=./tests/e2e-kubernetes/... \ GINKGO_FOCUS="\[ebs-csi-migration\]" \ EBS_CHECK_MIGRATION=true \ @@ -102,7 +102,7 @@ test-e2e-migration: .PHONY: test-e2e-external test-e2e-external: AWS_REGION=us-west-2 \ - AWS_AVAILABILITY_ZONES=us-west-2a \ + AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \ TEST_PATH=./tests/e2e-kubernetes/... \ GINKGO_FOCUS="External.Storage" \ GINKGO_SKIP="\[Disruptive\]|\[Serial\]" \ From aeb816f3c6b6b0ca094e777f520f005676d0423d Mon Sep 17 00:00:00 2001 From: Eytan Hanig Date: Mon, 7 Jun 2021 20:53:45 -0700 Subject: [PATCH 06/59] Fix podLabels case in Helm chart --- charts/aws-ebs-csi-driver/Chart.yaml | 2 +- charts/aws-ebs-csi-driver/templates/controller.yaml | 2 +- charts/aws-ebs-csi-driver/templates/node.yaml | 2 +- charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index 8d3d6e8e76..fe9174e802 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.1.0" name: aws-ebs-csi-driver description: A Helm chart for AWS EBS CSI Driver -version: 1.2.1 +version: 1.2.2 kubeVersion: ">=1.17.0-0" home: https://github.com/kubernetes-sigs/aws-ebs-csi-driver sources: diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index 1ba9c15cca..e0c710270f 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -17,7 +17,7 @@ spec: app: ebs-csi-controller {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }} {{- if .Values.controller.podLabels }} - {{- toYaml .Values.controller.podlabels | nindent 8 }} + {{- toYaml .Values.controller.podLabels | nindent 8 }} {{- end }} {{- if .Values.controller.podAnnotations }} annotations: diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index 2546bf5d6a..c300517467 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -16,7 +16,7 @@ spec: app: ebs-csi-node {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }} {{- if .Values.node.podLabels }} - {{- toYaml .Values.node.podlabels | nindent 8 }} + {{- toYaml .Values.node.podLabels | nindent 8 }} {{- end }} {{- with .Values.node.podAnnotations }} annotations: diff --git a/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml b/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml index 9b9903ac4d..bc078f6dd3 100644 --- a/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml @@ -19,7 +19,7 @@ spec: app: ebs-snapshot-controller {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }} {{- if .Values.snapshotController.podLabels }} - {{- toYaml .Values.snapshotController.podlabels | nindent 8 }} + {{- toYaml .Values.snapshotController.podLabels | nindent 8 }} {{- end }} {{- if .Values.snapshotController.podAnnotations }} annotations: {{ toYaml .Values.snapshotController.podAnnotations | nindent 8 }} From 383299e626d461959336db03541289fb4fd3e942 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 8 Jun 2021 17:43:29 -0700 Subject: [PATCH 07/59] update inFlight cache to avoid race condition on volume operation --- pkg/driver/controller.go | 180 ++++++++++++++++++++++---------- pkg/driver/controller_test.go | 111 +++++++++++++++++--- pkg/driver/internal/inflight.go | 4 + 3 files changed, 227 insertions(+), 68 deletions(-) diff --git a/pkg/driver/controller.go b/pkg/driver/controller.go index 03a550deff..21f37eb97f 100644 --- a/pkg/driver/controller.go +++ b/pkg/driver/controller.go @@ -99,27 +99,21 @@ func newControllerService(driverOptions *DriverOptions) controllerService { func (d *controllerService) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) { klog.V(4).Infof("CreateVolume: called with args %+v", *req) - volName := req.GetName() - if len(volName) == 0 { - return nil, status.Error(codes.InvalidArgument, "Volume name not provided") + if err := validateCreateVolumeRequest(req); err != nil { + return nil, err } - volSizeBytes, err := getVolSizeBytes(req) if err != nil { return nil, err } + volName := req.GetName() - volCaps := req.GetVolumeCapabilities() - if len(volCaps) == 0 { - return nil, status.Error(codes.InvalidArgument, "Volume capabilities not provided") - } - - if !isValidVolumeCapabilities(volCaps) { - modes := util.GetAccessModes(volCaps) - stringModes := strings.Join(*modes, ", ") - errString := "Volume capabilities " + stringModes + " not supported. Only AccessModes[ReadWriteOnce] supported." - return nil, status.Error(codes.InvalidArgument, errString) + // check if a request is already in-flight + if ok := d.inFlight.Insert(volName); !ok { + msg := fmt.Sprintf("Create volume request for %s is already in progress", volName) + return nil, status.Error(codes.Aborted, msg) } + defer d.inFlight.Delete(volName) disk, err := d.cloud.GetDiskByName(ctx, volName, volSizeBytes) if err != nil { @@ -217,13 +211,6 @@ func (d *controllerService) CreateVolume(ctx context.Context, req *csi.CreateVol return newCreateVolumeResponse(disk), nil } - // check if a request is already in-flight because the CreateVolume API is not idempotent - if ok := d.inFlight.Insert(req.String()); !ok { - msg := fmt.Sprintf("Create volume request for %s is already in progress", volName) - return nil, status.Error(codes.Aborted, msg) - } - defer d.inFlight.Delete(req.String()) - // create a new volume zone := pickAvailabilityZone(req.GetAccessibilityRequirements()) outpostArn := getOutpostArn(req.GetAccessibilityRequirements()) @@ -264,12 +251,40 @@ func (d *controllerService) CreateVolume(ctx context.Context, req *csi.CreateVol return newCreateVolumeResponse(disk), nil } +func validateCreateVolumeRequest(req *csi.CreateVolumeRequest) error { + volName := req.GetName() + if len(volName) == 0 { + return status.Error(codes.InvalidArgument, "Volume name not provided") + } + + volCaps := req.GetVolumeCapabilities() + if len(volCaps) == 0 { + return status.Error(codes.InvalidArgument, "Volume capabilities not provided") + } + + if !isValidVolumeCapabilities(volCaps) { + modes := util.GetAccessModes(volCaps) + stringModes := strings.Join(*modes, ", ") + errString := "Volume capabilities " + stringModes + " not supported. Only AccessModes[ReadWriteOnce] supported." + return status.Error(codes.InvalidArgument, errString) + } + return nil +} + func (d *controllerService) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) { klog.V(4).Infof("DeleteVolume: called with args: %+v", *req) + if err := validateDeleteVolumeRequest(req); err != nil { + return nil, err + } + volumeID := req.GetVolumeId() - if len(volumeID) == 0 { - return nil, status.Error(codes.InvalidArgument, "Volume ID not provided") + + // check if a request is already in-flight + if ok := d.inFlight.Insert(volumeID); !ok { + msg := fmt.Sprintf(internal.VolumeOperationAlreadyExistsErrorMsg, volumeID) + return nil, status.Error(codes.Aborted, msg) } + defer d.inFlight.Delete(volumeID) if _, err := d.cloud.DeleteDisk(ctx, volumeID); err != nil { if err == cloud.ErrNotFound { @@ -282,30 +297,21 @@ func (d *controllerService) DeleteVolume(ctx context.Context, req *csi.DeleteVol return &csi.DeleteVolumeResponse{}, nil } +func validateDeleteVolumeRequest(req *csi.DeleteVolumeRequest) error { + if len(req.GetVolumeId()) == 0 { + return status.Error(codes.InvalidArgument, "Volume ID not provided") + } + return nil +} + func (d *controllerService) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error) { klog.V(4).Infof("ControllerPublishVolume: called with args %+v", *req) - volumeID := req.GetVolumeId() - if len(volumeID) == 0 { - return nil, status.Error(codes.InvalidArgument, "Volume ID not provided") + if err := validateControllerPublishVolumeRequest(req); err != nil { + return nil, err } + volumeID := req.GetVolumeId() nodeID := req.GetNodeId() - if len(nodeID) == 0 { - return nil, status.Error(codes.InvalidArgument, "Node ID not provided") - } - - volCap := req.GetVolumeCapability() - if volCap == nil { - return nil, status.Error(codes.InvalidArgument, "Volume capability not provided") - } - - caps := []*csi.VolumeCapability{volCap} - if !isValidVolumeCapabilities(caps) { - modes := util.GetAccessModes(caps) - stringModes := strings.Join(*modes, ", ") - errString := "Volume capabilities " + stringModes + " not supported. Only AccessModes[ReadWriteOnce] supported." - return nil, status.Error(codes.InvalidArgument, errString) - } if !d.cloud.IsExistInstance(ctx, nodeID) { return nil, status.Errorf(codes.NotFound, "Instance %q not found", nodeID) @@ -333,17 +339,38 @@ func (d *controllerService) ControllerPublishVolume(ctx context.Context, req *cs return &csi.ControllerPublishVolumeResponse{PublishContext: pvInfo}, nil } +func validateControllerPublishVolumeRequest(req *csi.ControllerPublishVolumeRequest) error { + if len(req.GetVolumeId()) == 0 { + return status.Error(codes.InvalidArgument, "Volume ID not provided") + } + + if len(req.GetNodeId()) == 0 { + return status.Error(codes.InvalidArgument, "Node ID not provided") + } + + volCap := req.GetVolumeCapability() + if volCap == nil { + return status.Error(codes.InvalidArgument, "Volume capability not provided") + } + + caps := []*csi.VolumeCapability{volCap} + if !isValidVolumeCapabilities(caps) { + modes := util.GetAccessModes(caps) + stringModes := strings.Join(*modes, ", ") + errString := "Volume capabilities " + stringModes + " not supported. Only AccessModes[ReadWriteOnce] supported." + return status.Error(codes.InvalidArgument, errString) + } + return nil +} + func (d *controllerService) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error) { klog.V(4).Infof("ControllerUnpublishVolume: called with args %+v", *req) - volumeID := req.GetVolumeId() - if len(volumeID) == 0 { - return nil, status.Error(codes.InvalidArgument, "Volume ID not provided") + if err := validateControllerUnpublishVolumeRequest(req); err != nil { + return nil, err } + volumeID := req.GetVolumeId() nodeID := req.GetNodeId() - if len(nodeID) == 0 { - return nil, status.Error(codes.InvalidArgument, "Node ID not provided") - } if err := d.cloud.DetachDisk(ctx, volumeID, nodeID); err != nil { if err == cloud.ErrNotFound { @@ -356,6 +383,18 @@ func (d *controllerService) ControllerUnpublishVolume(ctx context.Context, req * return &csi.ControllerUnpublishVolumeResponse{}, nil } +func validateControllerUnpublishVolumeRequest(req *csi.ControllerUnpublishVolumeRequest) error { + if len(req.GetVolumeId()) == 0 { + return status.Error(codes.InvalidArgument, "Volume ID not provided") + } + + if len(req.GetNodeId()) == 0 { + return status.Error(codes.InvalidArgument, "Node ID not provided") + } + + return nil +} + func (d *controllerService) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error) { klog.V(4).Infof("ControllerGetCapabilities: called with args %+v", *req) var caps []*csi.ControllerServiceCapability @@ -489,15 +528,20 @@ func isValidVolumeContext(volContext map[string]string) bool { func (d *controllerService) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) { klog.V(4).Infof("CreateSnapshot: called with args %+v", req) - snapshotName := req.GetName() - if len(snapshotName) == 0 { - return nil, status.Error(codes.InvalidArgument, "Snapshot name not provided") + if err := validateCreateSnapshotRequest(req); err != nil { + return nil, err } + snapshotName := req.GetName() volumeID := req.GetSourceVolumeId() - if len(volumeID) == 0 { - return nil, status.Error(codes.InvalidArgument, "Snapshot volume source ID not provided") + + // check if a request is already in-flight + if ok := d.inFlight.Insert(snapshotName); !ok { + msg := fmt.Sprintf(internal.VolumeOperationAlreadyExistsErrorMsg, snapshotName) + return nil, status.Error(codes.Aborted, msg) } + defer d.inFlight.Delete(snapshotName) + snapshot, err := d.cloud.GetSnapshotByName(ctx, snapshotName) if err != nil && err != cloud.ErrNotFound { klog.Errorf("Error looking for the snapshot %s: %v", snapshotName, err) @@ -535,12 +579,31 @@ func (d *controllerService) CreateSnapshot(ctx context.Context, req *csi.CreateS return newCreateSnapshotResponse(snapshot) } +func validateCreateSnapshotRequest(req *csi.CreateSnapshotRequest) error { + if len(req.GetName()) == 0 { + return status.Error(codes.InvalidArgument, "Snapshot name not provided") + } + + if len(req.GetSourceVolumeId()) == 0 { + return status.Error(codes.InvalidArgument, "Snapshot volume source ID not provided") + } + return nil +} + func (d *controllerService) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) { klog.V(4).Infof("DeleteSnapshot: called with args %+v", req) + if err := validateDeleteSnapshotRequest(req); err != nil { + return nil, err + } + snapshotID := req.GetSnapshotId() - if len(snapshotID) == 0 { - return nil, status.Error(codes.InvalidArgument, "Snapshot ID not provided") + + // check if a request is already in-flight + if ok := d.inFlight.Insert(snapshotID); !ok { + msg := fmt.Sprintf("DeleteSnapshot for Snapshot %s is already in progress", snapshotID) + return nil, status.Error(codes.Aborted, msg) } + defer d.inFlight.Delete(snapshotID) if _, err := d.cloud.DeleteSnapshot(ctx, snapshotID); err != nil { if err == cloud.ErrNotFound { @@ -553,6 +616,13 @@ func (d *controllerService) DeleteSnapshot(ctx context.Context, req *csi.DeleteS return &csi.DeleteSnapshotResponse{}, nil } +func validateDeleteSnapshotRequest(req *csi.DeleteSnapshotRequest) error { + if len(req.GetSnapshotId()) == 0 { + return status.Error(codes.InvalidArgument, "Snapshot ID not provided") + } + return nil +} + func (d *controllerService) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) { klog.V(4).Infof("ListSnapshots: called with args %+v", req) var snapshots []*cloud.Snapshot diff --git a/pkg/driver/controller_test.go b/pkg/driver/controller_test.go index 84d78db1b0..ca2f96115a 100644 --- a/pkg/driver/controller_test.go +++ b/pkg/driver/controller_test.go @@ -1536,11 +1536,10 @@ func TestCreateVolume(t *testing.T) { defer mockCtl.Finish() mockCloud := mocks.NewMockCloud(mockCtl) - mockCloud.EXPECT().GetDiskByName(gomock.Eq(ctx), gomock.Eq(req.Name), gomock.Eq(stdVolSize)).Return(nil, cloud.ErrNotFound) inFlight := internal.NewInFlight() - inFlight.Insert(req.String()) - defer inFlight.Delete(req.String()) + inFlight.Insert(req.GetName()) + defer inFlight.Delete(req.GetName()) awsDriver := controllerService{ cloud: mockCloud, @@ -1549,17 +1548,8 @@ func TestCreateVolume(t *testing.T) { } _, err := awsDriver.CreateVolume(ctx, req) - if err == nil { - t.Fatalf("Expected CreateVolume to fail but got no error") - } - srvErr, ok := status.FromError(err) - if !ok { - t.Fatalf("Could not get error status code from error: %v", srvErr) - } - if srvErr.Code() != codes.Aborted { - t.Fatalf("Expected Aborted but got: %s", srvErr.Code()) - } + checkAbortedErrorCode(t, err) }, }, { @@ -1714,6 +1704,31 @@ func TestDeleteVolume(t *testing.T) { } }, }, + { + name: "fail another request already in-flight", + testFunc: func(t *testing.T) { + req := &csi.DeleteVolumeRequest{ + VolumeId: "vol-test", + } + + ctx := context.Background() + mockCtl := gomock.NewController(t) + defer mockCtl.Finish() + + mockCloud := mocks.NewMockCloud(mockCtl) + inFlight := internal.NewInFlight() + inFlight.Insert(req.GetVolumeId()) + defer inFlight.Delete(req.GetVolumeId()) + awsDriver := controllerService{ + cloud: mockCloud, + inFlight: inFlight, + driverOptions: &DriverOptions{}, + } + _, err := awsDriver.DeleteVolume(ctx, req) + + checkAbortedErrorCode(t, err) + }, + }, } for _, tc := range testCases { @@ -2259,6 +2274,34 @@ func TestCreateSnapshot(t *testing.T) { } }, }, + { + name: "fail with another request in-flight", + testFunc: func(t *testing.T) { + req := &csi.CreateSnapshotRequest{ + Name: "test-snapshot", + Parameters: nil, + SourceVolumeId: "vol-test", + } + + mockCtl := gomock.NewController(t) + defer mockCtl.Finish() + + mockCloud := mocks.NewMockCloud(mockCtl) + + inFlight := internal.NewInFlight() + inFlight.Insert(req.GetName()) + defer inFlight.Delete(req.GetName()) + + awsDriver := controllerService{ + cloud: mockCloud, + inFlight: inFlight, + driverOptions: &DriverOptions{}, + } + _, err := awsDriver.CreateSnapshot(context.Background(), req) + + checkAbortedErrorCode(t, err) + }, + }, } for _, tc := range testCases { @@ -2321,6 +2364,34 @@ func TestDeleteSnapshot(t *testing.T) { } }, }, + { + name: "fail with another request in-flight", + testFunc: func(t *testing.T) { + ctx := context.Background() + + mockCtl := gomock.NewController(t) + defer mockCtl.Finish() + + mockCloud := mocks.NewMockCloud(mockCtl) + + req := &csi.DeleteSnapshotRequest{ + SnapshotId: "test-snapshotID", + } + inFlight := internal.NewInFlight() + inFlight.Insert(req.GetSnapshotId()) + defer inFlight.Delete(req.GetSnapshotId()) + + awsDriver := controllerService{ + cloud: mockCloud, + inFlight: inFlight, + driverOptions: &DriverOptions{}, + } + + _, err := awsDriver.DeleteSnapshot(ctx, req) + + checkAbortedErrorCode(t, err) + }, + }, } for _, tc := range testCases { @@ -3082,3 +3153,17 @@ func TestControllerExpandVolume(t *testing.T) { }) } } + +func checkAbortedErrorCode(t *testing.T, err error) { + if err == nil { + t.Fatalf("Expected operation to fail but got no error") + } + + srvErr, ok := status.FromError(err) + if !ok { + t.Fatalf("Could not get error status code from error: %v", srvErr) + } + if srvErr.Code() != codes.Aborted { + t.Fatalf("Expected Aborted but got: %s", srvErr.Code()) + } +} diff --git a/pkg/driver/internal/inflight.go b/pkg/driver/internal/inflight.go index 5f0d2a9ad7..9b45680fbc 100644 --- a/pkg/driver/internal/inflight.go +++ b/pkg/driver/internal/inflight.go @@ -30,6 +30,10 @@ type Idempotent interface { String() string } +const ( + VolumeOperationAlreadyExistsErrorMsg = "An operation with the given Volume %s already exists" +) + // InFlight is a struct used to manage in flight requests per volumeId. type InFlight struct { mux *sync.Mutex From 1ea2f792058fbd3739e3578b39be4ce63f513e47 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 31 May 2021 18:40:54 +0200 Subject: [PATCH 08/59] Disable xfs uuids --- pkg/driver/node.go | 30 ++++++++++++++++++++++++------ pkg/driver/node_test.go | 4 ++-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/pkg/driver/node.go b/pkg/driver/node.go index 46dd519e61..b11251eb71 100644 --- a/pkg/driver/node.go +++ b/pkg/driver/node.go @@ -143,12 +143,7 @@ func (d *nodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol fsType = defaultFsType } - var mountOptions []string - for _, f := range mountVolume.MountFlags { - if !hasMountOption(mountOptions, f) { - mountOptions = append(mountOptions, f) - } - } + mountOptions := collectMountOptions(fsType, mountVolume.MountFlags) if ok := d.inFlight.Insert(volumeID); !ok { return nil, status.Errorf(codes.Aborted, VolumeOperationAlreadyExists, volumeID) @@ -624,6 +619,8 @@ func (d *nodeService) nodePublishVolumeForFileSystem(req *csi.NodePublishVolumeR fsType = defaultFsType } + mountOptions = collectMountOptions(fsType, mountOptions) + klog.V(4).Infof("NodePublishVolume: mounting %s at %s with option %s as fstype %s", source, target, mountOptions, fsType) if err := d.mounter.Mount(source, target, fsType, mountOptions); err != nil { if removeErr := os.Remove(target); removeErr != nil { @@ -659,3 +656,24 @@ func hasMountOption(options []string, opt string) bool { } return false } + +// collectMountOptions returns array of mount options from +// VolumeCapability_MountVolume and special mount options for +// given filesystem. +func collectMountOptions(fsType string, mntFlags []string) []string { + var options []string + for _, opt := range mntFlags { + if !hasMountOption(options, opt) { + options = append(options, opt) + } + } + + // By default, xfs does not allow mounting of two volumes with the same filesystem uuid. + // Force ignore this uuid to be able to mount volume + its clone / restored snapshot on the same node. + if fsType == FSTypeXfs { + if !hasMountOption(options, "nouuid") { + options = append(options, "nouuid") + } + } + return options +} diff --git a/pkg/driver/node_test.go b/pkg/driver/node_test.go index f1e16ea8c6..c19157d764 100644 --- a/pkg/driver/node_test.go +++ b/pkg/driver/node_test.go @@ -613,7 +613,7 @@ func TestNodePublishVolume(t *testing.T) { }, }, { - name: "success fstype", + name: "success fstype xfs", testFunc: func(t *testing.T) { mockCtl := gomock.NewController(t) defer mockCtl.Finish() @@ -628,7 +628,7 @@ func TestNodePublishVolume(t *testing.T) { } mockMounter.EXPECT().MakeDir(gomock.Eq(targetPath)).Return(nil) - mockMounter.EXPECT().Mount(gomock.Eq(stagingTargetPath), gomock.Eq(targetPath), gomock.Eq(FSTypeXfs), gomock.Eq([]string{"bind"})).Return(nil) + mockMounter.EXPECT().Mount(gomock.Eq(stagingTargetPath), gomock.Eq(targetPath), gomock.Eq(FSTypeXfs), gomock.Eq([]string{"bind", "nouuid"})).Return(nil) req := &csi.NodePublishVolumeRequest{ PublishContext: map[string]string{DevicePathKey: devicePath}, From a2d7b762271dd08a2a633a3d56d3d127cb8e4b80 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 25 May 2021 15:59:22 -0700 Subject: [PATCH 09/59] Refactor metadata.go to test that k8s client is initialized iff ec2 metadata is unavailable --- pkg/cloud/metadata.go | 177 +++++++++-------- pkg/cloud/metadata_test.go | 325 +++++++++++++------------------- pkg/driver/controller.go | 4 +- pkg/driver/controller_test.go | 2 +- pkg/driver/node.go | 2 +- tests/integration/setup_test.go | 3 +- 6 files changed, 234 insertions(+), 279 deletions(-) diff --git a/pkg/cloud/metadata.go b/pkg/cloud/metadata.go index e2c7ec29ec..995b043a59 100644 --- a/pkg/cloud/metadata.go +++ b/pkg/cloud/metadata.go @@ -34,6 +34,7 @@ import ( "k8s.io/klog" ) +// Metadata is info about the ec2 instance on which the driver is running type Metadata struct { InstanceID string InstanceType string @@ -72,84 +73,58 @@ func (m *Metadata) GetOutpostArn() arn.ARN { return m.OutpostArn } -func NewMetadata() (MetadataService, error) { +type EC2MetadataClient func() (EC2Metadata, error) + +var DefaultEC2MetadataClient = func() (EC2Metadata, error) { sess := session.Must(session.NewSession(&aws.Config{})) svc := ec2metadata.New(sess) - var clientset *kubernetes.Clientset - if !svc.Available() { - // creates the in-cluster config - config, err := rest.InClusterConfig() - if err != nil { - return nil, err - } - // creates the clientset - clientset, err = kubernetes.NewForConfig(config) - if err != nil { - return nil, err - } + return svc, nil +} + +type KubernetesAPIClient func() (kubernetes.Interface, error) + +var DefaultKubernetesAPIClient = func() (kubernetes.Interface, error) { + // creates the in-cluster config + config, err := rest.InClusterConfig() + if err != nil { + return nil, err } - metadataService, err := NewMetadataService(svc, clientset) + // creates the clientset + clientset, err := kubernetes.NewForConfig(config) if err != nil { - return nil, fmt.Errorf("error getting information from metadata service or node object: %w", err) + return nil, err } - return metadataService, err + return clientset, nil } -// NewMetadataService returns a new MetadataServiceImplementation. -func NewMetadataService(svc EC2Metadata, clientset kubernetes.Interface) (MetadataService, error) { +func NewMetadataService(ec2MetadataClient EC2MetadataClient, k8sAPIClient KubernetesAPIClient) (MetadataService, error) { + klog.Infof("retrieving instance data from ec2 metadata") + svc, err := ec2MetadataClient() if !svc.Available() { - klog.Warningf("EC2 instance metadata is not available") - nodeName := os.Getenv("CSI_NODE_NAME") - if nodeName == "" { - return nil, fmt.Errorf("instance metadata is unavailable and CSI_NODE_NAME env var not set") - } - - // get node with k8s API - node, err := clientset.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{}) - if err != nil { - return nil, err - } - - providerID := node.Spec.ProviderID - if providerID == "" { - return nil, fmt.Errorf("node providerID empty, cannot parse") - } - - awsRegionRegex := "([a-z]{2}(-gov)?)-(central|(north|south)?(east|west)?)-[0-9]" - awsAvailabilityZoneRegex := "([a-z]{2}(-gov)?)-(central|(north|south)?(east|west)?)-[0-9][a-z]" - awsInstanceIDRegex := "i-[a-z0-9]+$" - - re := regexp.MustCompile(awsRegionRegex) - region := re.FindString(providerID) - if region == "" { - return nil, fmt.Errorf("did not find aws region in node providerID string") - } - - re = regexp.MustCompile(awsAvailabilityZoneRegex) - availabilityZone := re.FindString(providerID) - if availabilityZone == "" { - return nil, fmt.Errorf("did not find aws availability zone in node providerID string") - } - - re = regexp.MustCompile(awsInstanceIDRegex) - instanceID := re.FindString(providerID) - if instanceID == "" { - return nil, fmt.Errorf("did not find aws instance ID in node providerID string") - } - - metadata := Metadata{ - InstanceID: instanceID, - InstanceType: "", // we have no way to find this, so we leave it empty - Region: region, - AvailabilityZone: availabilityZone, - } + klog.Warning("ec2 metadata is not available") + } else if err != nil { + klog.Warningf("error creating ec2 metadata client: %v", err) + } else { + klog.Infof("ec2 metadata is available") + return EC2MetadataInstanceInfo(svc) + } - return &metadata, nil + klog.Infof("retrieving instance data from kubernetes api") + clientset, err := k8sAPIClient() + if err != nil { + klog.Warningf("error creating kubernetes api client: %v", err) + } else { + klog.Infof("kubernetes api is available") + return KubernetesAPIInstanceInfo(clientset) } + return nil, fmt.Errorf("error getting instance data from ec2 metadata or kubernetes api") +} + +func EC2MetadataInstanceInfo(svc EC2Metadata) (*Metadata, error) { doc, err := svc.GetInstanceIdentityDocument() if err != nil { - return nil, fmt.Errorf("could not get EC2 instance identity metadata") + return nil, fmt.Errorf("could not get EC2 instance identity metadata: %v", err) } if len(doc.InstanceID) == 0 { @@ -168,6 +143,13 @@ func NewMetadataService(svc EC2Metadata, clientset kubernetes.Interface) (Metada return nil, fmt.Errorf("could not get valid EC2 availability zone") } + instanceInfo := Metadata{ + InstanceID: doc.InstanceID, + InstanceType: doc.InstanceType, + Region: doc.Region, + AvailabilityZone: doc.AvailabilityZone, + } + outpostArn, err := svc.GetMetadata(OutpostArnEndpoint) // "outpust-arn" returns 404 for non-outpost instances. note that the request is made to a link-local address. // it's guaranteed to be in the form `arn::outposts:::outpost/` @@ -176,23 +158,64 @@ func NewMetadataService(svc EC2Metadata, clientset kubernetes.Interface) (Metada return nil, fmt.Errorf("something went wrong while getting EC2 outpost arn: %s", err.Error()) } else if err == nil { klog.Infof("Running in an outpost environment with arn: %s", outpostArn) + outpostArn = strings.ReplaceAll(outpostArn, "outpost/", "") + parsedArn, err := arn.Parse(outpostArn) + if err != nil { + klog.Warningf("Failed to parse the outpost arn: %s", outpostArn) + } else { + klog.Infof("Using outpost arn: %v", parsedArn) + instanceInfo.OutpostArn = parsedArn + } } - metadata := Metadata{ - InstanceID: doc.InstanceID, - InstanceType: doc.InstanceType, - Region: doc.Region, - AvailabilityZone: doc.AvailabilityZone, + return &instanceInfo, nil +} + +func KubernetesAPIInstanceInfo(clientset kubernetes.Interface) (*Metadata, error) { + nodeName := os.Getenv("CSI_NODE_NAME") + if nodeName == "" { + return nil, fmt.Errorf("CSI_NODE_NAME env var not set") } - outpostArn = strings.ReplaceAll(outpostArn, "outpost/", "") - parsedArn, err := arn.Parse(outpostArn) + // get node with k8s API + node, err := clientset.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{}) if err != nil { - klog.Warningf("Failed to parse the outpost arn: %s", outpostArn) - } else { - klog.Infof("Using outpost arn: %v", parsedArn) - metadata.OutpostArn = parsedArn + return nil, fmt.Errorf("error getting Node %v: %v", nodeName, err) + } + + providerID := node.Spec.ProviderID + if providerID == "" { + return nil, fmt.Errorf("node providerID empty, cannot parse") + } + + awsRegionRegex := "([a-z]{2}(-gov)?)-(central|(north|south)?(east|west)?)-[0-9]" + awsAvailabilityZoneRegex := "([a-z]{2}(-gov)?)-(central|(north|south)?(east|west)?)-[0-9][a-z]" + awsInstanceIDRegex := "i-[a-z0-9]+$" + + re := regexp.MustCompile(awsRegionRegex) + region := re.FindString(providerID) + if region == "" { + return nil, fmt.Errorf("did not find aws region in node providerID string") + } + + re = regexp.MustCompile(awsAvailabilityZoneRegex) + availabilityZone := re.FindString(providerID) + if availabilityZone == "" { + return nil, fmt.Errorf("did not find aws availability zone in node providerID string") + } + + re = regexp.MustCompile(awsInstanceIDRegex) + instanceID := re.FindString(providerID) + if instanceID == "" { + return nil, fmt.Errorf("did not find aws instance ID in node providerID string") + } + + instanceInfo := Metadata{ + InstanceID: instanceID, + InstanceType: "", // we have no way to find this, so we leave it empty + Region: region, + AvailabilityZone: availabilityZone, } - return &metadata, nil + return &instanceInfo, nil } diff --git a/pkg/cloud/metadata_test.go b/pkg/cloud/metadata_test.go index 11afa7b512..07ebd34bae 100644 --- a/pkg/cloud/metadata_test.go +++ b/pkg/cloud/metadata_test.go @@ -29,20 +29,17 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" k8s_testing "k8s.io/client-go/testing" ) -var ( - stdInstanceID = "instance-1" - stdInstanceType = "t2.medium" - stdRegion = "instance-1" - stdAvailabilityZone = "az-1" -) - const ( - nodeName = "ip-123-45-67-890.us-west-2.compute.internal" - nodeObjectInstanceID = "i-abcdefgh123456789" + nodeName = "ip-123-45-67-890.us-west-2.compute.internal" + stdInstanceID = "i-abcdefgh123456789" + stdInstanceType = "t2.medium" + stdRegion = "us-west-2" + stdAvailabilityZone = "us-west-2b" ) func TestNewMetadataService(t *testing.T) { @@ -51,75 +48,66 @@ func TestNewMetadataService(t *testing.T) { validOutpostArn, _ := arn.Parse(strings.ReplaceAll(validRawOutpostArn, "outpost/", "")) testCases := []struct { - name string - isAvailable bool - isPartial bool - identityDocument ec2metadata.EC2InstanceIdentityDocument - rawOutpostArn string - outpostArn arn.ARN - getInstanceDocErr error - getOutpostArnErr error // We should keep this specific to outpost-arn until we need to use more endpoints - getNodeErr error - node v1.Node - nodeNameEnvVar string + name string + ec2metadataAvailable bool + clientsetReactors func(*fake.Clientset) + getInstanceIdentityDocumentValue ec2metadata.EC2InstanceIdentityDocument + getInstanceIdentityDocumentError error + invalidInstanceIdentityDocument bool + getMetadataValue string + getMetadataError error + expectedOutpostArn arn.ARN + expectedErr error + node v1.Node + nodeNameEnvVar string }{ { - name: "success: normal", - isAvailable: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ + name: "success: normal", + ec2metadataAvailable: true, + getInstanceIdentityDocumentValue: ec2metadata.EC2InstanceIdentityDocument{ InstanceID: stdInstanceID, InstanceType: stdInstanceType, Region: stdRegion, AvailabilityZone: stdAvailabilityZone, }, - getInstanceDocErr: nil, }, { - name: "success: outpost-arn is available", - isAvailable: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ + name: "success: outpost-arn is available", + ec2metadataAvailable: true, + getInstanceIdentityDocumentValue: ec2metadata.EC2InstanceIdentityDocument{ InstanceID: stdInstanceID, InstanceType: stdInstanceType, Region: stdRegion, AvailabilityZone: stdAvailabilityZone, }, - rawOutpostArn: validRawOutpostArn, - outpostArn: validOutpostArn, - getInstanceDocErr: nil, + getMetadataValue: validRawOutpostArn, + expectedOutpostArn: validOutpostArn, }, { - name: "success: outpost-arn is invalid", - isAvailable: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ + name: "success: outpost-arn is invalid", + ec2metadataAvailable: true, + getInstanceIdentityDocumentValue: ec2metadata.EC2InstanceIdentityDocument{ InstanceID: stdInstanceID, InstanceType: stdInstanceType, Region: stdRegion, AvailabilityZone: stdAvailabilityZone, }, - getInstanceDocErr: nil, + getMetadataValue: "foo", }, { - name: "success: outpost-arn is not found", - isAvailable: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ + name: "success: outpost-arn is not found", + ec2metadataAvailable: true, + getInstanceIdentityDocumentValue: ec2metadata.EC2InstanceIdentityDocument{ InstanceID: stdInstanceID, InstanceType: stdInstanceType, Region: stdRegion, AvailabilityZone: stdAvailabilityZone, }, - getInstanceDocErr: nil, - getOutpostArnErr: fmt.Errorf("404"), + getMetadataError: fmt.Errorf("404"), }, { - name: "success: metadata not available, used k8s api", - isAvailable: false, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ - InstanceID: stdInstanceID, - InstanceType: stdInstanceType, - Region: stdRegion, - AvailabilityZone: stdAvailabilityZone, - }, - getInstanceDocErr: nil, + name: "success: metadata not available, used k8s api", + ec2metadataAvailable: false, node: v1.Node{ TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -129,50 +117,34 @@ func TestNewMetadataService(t *testing.T) { Name: nodeName, }, Spec: v1.NodeSpec{ - ProviderID: "aws:///us-west-2b/i-abcdefgh123456789", + ProviderID: "aws:///" + stdAvailabilityZone + "/" + stdInstanceID, }, Status: v1.NodeStatus{}, }, nodeNameEnvVar: nodeName, }, { - name: "failure: metadata not available, k8s client error", - isAvailable: false, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ - InstanceID: stdInstanceID, - InstanceType: stdInstanceType, - Region: stdRegion, - AvailabilityZone: stdAvailabilityZone, + name: "failure: metadata not available, k8s client error", + ec2metadataAvailable: false, + clientsetReactors: func(clientset *fake.Clientset) { + clientset.PrependReactor("get", "*", func(action k8s_testing.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, fmt.Errorf("client failure") + }) }, - getInstanceDocErr: nil, - getNodeErr: fmt.Errorf("client failure"), - nodeNameEnvVar: nodeName, + expectedErr: fmt.Errorf("error getting Node %s: client failure", nodeName), + nodeNameEnvVar: nodeName, }, { - name: "failure: metadata not available, node name env var not set", - isAvailable: false, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ - InstanceID: stdInstanceID, - InstanceType: stdInstanceType, - Region: stdRegion, - AvailabilityZone: stdAvailabilityZone, - }, - getInstanceDocErr: nil, - getNodeErr: fmt.Errorf("instance metadata is unavailable and CSI_NODE_NAME env var not set"), - nodeNameEnvVar: "", + name: "failure: metadata not available, node name env var not set", + ec2metadataAvailable: false, + expectedErr: fmt.Errorf("CSI_NODE_NAME env var not set"), + nodeNameEnvVar: "", }, { - name: "failure: metadata not available, no provider ID", - isAvailable: false, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ - InstanceID: stdInstanceID, - InstanceType: stdInstanceType, - Region: stdRegion, - AvailabilityZone: stdAvailabilityZone, - }, - getInstanceDocErr: nil, - getNodeErr: fmt.Errorf("node providerID empty, cannot parse"), + name: "failure: metadata not available, no provider ID", + ec2metadataAvailable: false, + expectedErr: fmt.Errorf("node providerID empty, cannot parse"), node: v1.Node{ TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -189,16 +161,9 @@ func TestNewMetadataService(t *testing.T) { nodeNameEnvVar: nodeName, }, { - name: "failure: metadata not available, invalid region", - isAvailable: false, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ - InstanceID: stdInstanceID, - InstanceType: stdInstanceType, - Region: stdRegion, - AvailabilityZone: stdAvailabilityZone, - }, - getInstanceDocErr: nil, - getNodeErr: fmt.Errorf("did not find aws region in node providerID string"), + name: "failure: metadata not available, invalid region", + ec2metadataAvailable: false, + expectedErr: fmt.Errorf("did not find aws region in node providerID string"), node: v1.Node{ TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -215,16 +180,9 @@ func TestNewMetadataService(t *testing.T) { nodeNameEnvVar: nodeName, }, { - name: "failure: metadata not available, invalid az", - isAvailable: false, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ - InstanceID: stdInstanceID, - InstanceType: stdInstanceType, - Region: stdRegion, - AvailabilityZone: stdAvailabilityZone, - }, - getInstanceDocErr: nil, - getNodeErr: fmt.Errorf("did not find aws availability zone in node providerID string"), + name: "failure: metadata not available, invalid az", + ec2metadataAvailable: false, + expectedErr: fmt.Errorf("did not find aws availability zone in node providerID string"), node: v1.Node{ TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -241,16 +199,9 @@ func TestNewMetadataService(t *testing.T) { nodeNameEnvVar: nodeName, }, { - name: "failure: metadata not available, invalid instance id", - isAvailable: false, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ - InstanceID: stdInstanceID, - InstanceType: stdInstanceType, - Region: stdRegion, - AvailabilityZone: stdAvailabilityZone, - }, - getInstanceDocErr: nil, - getNodeErr: fmt.Errorf("did not find aws instance ID in node providerID string"), + name: "failure: metadata not available, invalid instance id", + ec2metadataAvailable: false, + expectedErr: fmt.Errorf("did not find aws instance ID in node providerID string"), node: v1.Node{ TypeMeta: metav1.TypeMeta{ Kind: "Node", @@ -267,143 +218,123 @@ func TestNewMetadataService(t *testing.T) { nodeNameEnvVar: nodeName, }, { - name: "fail: GetInstanceIdentityDocument returned error", - isAvailable: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ - InstanceID: stdInstanceID, - InstanceType: stdInstanceType, - Region: stdRegion, - AvailabilityZone: stdAvailabilityZone, - }, - getInstanceDocErr: fmt.Errorf(""), + name: "fail: GetInstanceIdentityDocument returned error", + ec2metadataAvailable: true, + getInstanceIdentityDocumentError: fmt.Errorf("foo"), + expectedErr: fmt.Errorf("could not get EC2 instance identity metadata: foo"), }, { - name: "fail: GetInstanceIdentityDocument returned empty instance", - isAvailable: true, - isPartial: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ + name: "fail: GetInstanceIdentityDocument returned empty instance", + ec2metadataAvailable: true, + getInstanceIdentityDocumentValue: ec2metadata.EC2InstanceIdentityDocument{ InstanceID: "", InstanceType: stdInstanceType, Region: stdRegion, AvailabilityZone: stdAvailabilityZone, }, - getInstanceDocErr: nil, + invalidInstanceIdentityDocument: true, + expectedErr: fmt.Errorf("could not get valid EC2 instance ID"), }, { - name: "fail: GetInstanceIdentityDocument returned empty region", - isAvailable: true, - isPartial: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ + name: "fail: GetInstanceIdentityDocument returned empty region", + ec2metadataAvailable: true, + getInstanceIdentityDocumentValue: ec2metadata.EC2InstanceIdentityDocument{ InstanceID: stdInstanceID, InstanceType: stdInstanceType, Region: "", AvailabilityZone: stdAvailabilityZone, }, - getInstanceDocErr: nil, + invalidInstanceIdentityDocument: true, + expectedErr: fmt.Errorf("could not get valid EC2 region"), }, { - name: "fail: GetInstanceIdentityDocument returned empty az", - isAvailable: true, - isPartial: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ + name: "fail: GetInstanceIdentityDocument returned empty az", + ec2metadataAvailable: true, + getInstanceIdentityDocumentValue: ec2metadata.EC2InstanceIdentityDocument{ InstanceID: stdInstanceID, InstanceType: stdInstanceType, Region: stdRegion, AvailabilityZone: "", }, - getInstanceDocErr: nil, + invalidInstanceIdentityDocument: true, + expectedErr: fmt.Errorf("could not get valid EC2 availability zone"), }, { - name: "fail: outpost-arn failed", - isAvailable: true, - identityDocument: ec2metadata.EC2InstanceIdentityDocument{ + name: "fail: outpost-arn failed", + ec2metadataAvailable: true, + getInstanceIdentityDocumentValue: ec2metadata.EC2InstanceIdentityDocument{ InstanceID: stdInstanceID, InstanceType: stdInstanceType, Region: stdRegion, AvailabilityZone: stdAvailabilityZone, }, - getInstanceDocErr: nil, - getOutpostArnErr: fmt.Errorf("405"), + getMetadataError: fmt.Errorf("405"), + expectedErr: fmt.Errorf("something went wrong while getting EC2 outpost arn: 405"), }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { clientset := fake.NewSimpleClientset(&tc.node) - if tc.name == "failure: metadata not available, k8s client error" { - clientset.PrependReactor("get", "*", func(action k8s_testing.Action) (handled bool, ret runtime.Object, err error) { - return true, nil, fmt.Errorf("client failure") - }) + clientsetInitialized := false + if tc.clientsetReactors != nil { + tc.clientsetReactors(clientset) } + mockCtrl := gomock.NewController(t) mockEC2Metadata := mocks.NewMockEC2Metadata(mockCtrl) - mockEC2Metadata.EXPECT().Available().Return(tc.isAvailable) - os.Setenv("CSI_NODE_NAME", tc.nodeNameEnvVar) - if tc.isAvailable { - mockEC2Metadata.EXPECT().GetInstanceIdentityDocument().Return(tc.identityDocument, tc.getInstanceDocErr) - } + ec2MetadataClient := func() (EC2Metadata, error) { return mockEC2Metadata, nil } + k8sAPIClient := func() (kubernetes.Interface, error) { clientsetInitialized = true; return clientset, nil } - if tc.isAvailable && tc.getInstanceDocErr == nil && !tc.isPartial { - mockEC2Metadata.EXPECT().GetMetadata(OutpostArnEndpoint).Return(tc.rawOutpostArn, tc.getOutpostArnErr) - } + mockEC2Metadata.EXPECT().Available().Return(tc.ec2metadataAvailable) + if tc.ec2metadataAvailable { + mockEC2Metadata.EXPECT().GetInstanceIdentityDocument().Return(tc.getInstanceIdentityDocumentValue, tc.getInstanceIdentityDocumentError) - m, err := NewMetadataService(mockEC2Metadata, clientset) - if tc.isAvailable && tc.getInstanceDocErr == nil && tc.getOutpostArnErr == nil && !tc.isPartial { - if err != nil { - t.Fatalf("NewMetadataService() failed: expected no error, got %v", err) + // GetMetadata is to get the outpost ARN. It should be skipped if + // GetInstanceIdentityDocument returns an error or (somehow?) partial + // output + if tc.getInstanceIdentityDocumentError == nil && !tc.invalidInstanceIdentityDocument { + if tc.getMetadataValue != "" || tc.getMetadataError != nil { + mockEC2Metadata.EXPECT().GetMetadata(OutpostArnEndpoint).Return(tc.getMetadataValue, tc.getMetadataError) + } else { + mockEC2Metadata.EXPECT().GetMetadata(OutpostArnEndpoint).Return("", fmt.Errorf("404")) + } } - - if m.GetInstanceID() != tc.identityDocument.InstanceID { - t.Fatalf("GetInstanceID() failed: expected %v, got %v", tc.identityDocument.InstanceID, m.GetInstanceID()) + if clientsetInitialized == true { + t.Errorf("kubernetes client was unexpectedly initialized when metadata is available!") + if len(clientset.Actions()) > 0 { + t.Errorf("kubernetes client was unexpectedly called! %v", clientset.Actions()) + } } + } - if m.GetInstanceType() != tc.identityDocument.InstanceType { - t.Fatalf("GetInstanceType() failed: expected %v, got %v", tc.identityDocument.InstanceType, m.GetInstanceType()) - } + os.Setenv("CSI_NODE_NAME", tc.nodeNameEnvVar) - if m.GetRegion() != tc.identityDocument.Region { - t.Fatalf("GetRegion() failed: expected %v, got %v", tc.identityDocument.Region, m.GetRegion()) + m, err := NewMetadataService(ec2MetadataClient, k8sAPIClient) + if err != nil { + if tc.expectedErr == nil { + t.Errorf("got error %q, expected no error", err) + } else if err.Error() != tc.expectedErr.Error() { + t.Errorf("got error %q, expected %q", err, tc.expectedErr) } - - if m.GetAvailabilityZone() != tc.identityDocument.AvailabilityZone { - t.Fatalf("GetAvailabilityZone() failed: expected %v, got %v", tc.identityDocument.AvailabilityZone, m.GetAvailabilityZone()) + } else { + if m == nil { + t.Fatalf("metadataService is unexpectedly nil!") } - - if m.GetOutpostArn() != tc.outpostArn { - t.Fatalf("GetOutpostArn() failed: expected %v, got %v", tc.outpostArn, m.GetOutpostArn()) + if m.GetInstanceID() != stdInstanceID { + t.Errorf("NewMetadataService() failed: got wrong instance ID %v, expected %v", m.GetInstanceID(), stdInstanceID) } - } else if !tc.isAvailable { - if tc.name == "success: metadata not available, used k8s api" { - if err != nil { - t.Fatalf("NewMetadataService() failed: expected no error, got %v", err) - } - if m.GetInstanceID() != nodeObjectInstanceID { - t.Fatalf("NewMetadataService() failed: got wrong instance ID %v, expected %v", m.GetInstanceID(), nodeObjectInstanceID) - } - if m.GetRegion() != "us-west-2" { - t.Fatalf("NewMetadataService() failed: got wrong region %v, expected %v", m.GetRegion(), "us-west-2") - } - if m.GetAvailabilityZone() != "us-west-2b" { - t.Fatalf("NewMetadataService() failed: got wrong AZ %v, expected %v", m.GetRegion(), "us-west-2b") - } - if m.GetOutpostArn() != tc.outpostArn { - t.Fatalf("GetOutpostArn() failed: got %v, expected %v", m.GetOutpostArn(), tc.outpostArn) - } - } else { - if err == nil { - t.Fatalf("NewMetadataService() failed: expected error but got nothing") - } - if err.Error() != tc.getNodeErr.Error() { - t.Fatalf("NewMetadataService() returned an unexpected error. Expected %v, got %v", tc.getNodeErr, err) - } + if m.GetRegion() != stdRegion { + t.Errorf("NewMetadataService() failed: got wrong region %v, expected %v", m.GetRegion(), stdRegion) } - } else { - if err == nil && tc.getOutpostArnErr == nil { - t.Fatal("NewMetadataService() failed: expected error when GetInstanceIdentityDocument returns partial data, got nothing") + if m.GetAvailabilityZone() != stdAvailabilityZone { + t.Errorf("NewMetadataService() failed: got wrong AZ %v, expected %v", m.GetAvailabilityZone(), stdAvailabilityZone) + } + if m.GetOutpostArn() != tc.expectedOutpostArn { + t.Errorf("GetOutpostArn() failed: got %v, expected %v", m.GetOutpostArn(), tc.expectedOutpostArn) } } - mockCtrl.Finish() }) } diff --git a/pkg/driver/controller.go b/pkg/driver/controller.go index 21f37eb97f..367612b7e4 100644 --- a/pkg/driver/controller.go +++ b/pkg/driver/controller.go @@ -66,7 +66,7 @@ type controllerService struct { var ( // NewMetadataFunc is a variable for the cloud.NewMetadata function that can // be overwritten in unit tests. - NewMetadataFunc = cloud.NewMetadata + NewMetadataFunc = cloud.NewMetadataService // NewCloudFunc is a variable for the cloud.NewCloud function that can // be overwritten in unit tests. NewCloudFunc = cloud.NewCloud @@ -78,7 +78,7 @@ func newControllerService(driverOptions *DriverOptions) controllerService { region := os.Getenv("AWS_REGION") if region == "" { klog.V(5).Infof("[Debug] Retrieving region from metadata service") - metadata, err := NewMetadataFunc() + metadata, err := NewMetadataFunc(cloud.DefaultEC2MetadataClient, cloud.DefaultKubernetesAPIClient) if err != nil { panic(err) } diff --git a/pkg/driver/controller_test.go b/pkg/driver/controller_test.go index ca2f96115a..1af505b325 100644 --- a/pkg/driver/controller_test.go +++ b/pkg/driver/controller_test.go @@ -109,7 +109,7 @@ func TestNewControllerService(t *testing.T) { oldNewMetadataFunc := NewMetadataFunc defer func() { NewMetadataFunc = oldNewMetadataFunc }() - NewMetadataFunc = func() (cloud.MetadataService, error) { + NewMetadataFunc = func(cloud.EC2MetadataClient, cloud.KubernetesAPIClient) (cloud.MetadataService, error) { if tc.newMetadataFuncErrors { return nil, testErr } diff --git a/pkg/driver/node.go b/pkg/driver/node.go index 7b67a51271..c844cc4416 100644 --- a/pkg/driver/node.go +++ b/pkg/driver/node.go @@ -83,7 +83,7 @@ type nodeService struct { // it panics if failed to create the service func newNodeService(driverOptions *DriverOptions) nodeService { klog.V(5).Infof("[Debug] Retrieving node info from metadata service") - metadata, err := cloud.NewMetadata() + metadata, err := cloud.NewMetadataService(cloud.DefaultEC2MetadataClient, cloud.DefaultKubernetesAPIClient) if err != nil { panic(err) } diff --git a/tests/integration/setup_test.go b/tests/integration/setup_test.go index 10cec7b371..d1d3140ca3 100644 --- a/tests/integration/setup_test.go +++ b/tests/integration/setup_test.go @@ -32,6 +32,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "google.golang.org/grpc" + "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" ) @@ -110,7 +111,7 @@ func newMetadata() (cloud.MetadataService, error) { return nil, err } - return cloud.NewMetadataService(ec2metadata.New(s), fake.NewSimpleClientset()) + return cloud.NewMetadataService(func() (cloud.EC2Metadata, error) { return ec2metadata.New(s), nil }, func() (kubernetes.Interface, error) { return fake.NewSimpleClientset(), nil }) } func newEC2Client() (*ec2.EC2, error) { From 8a379cf5d73f68c3c44705afd281bbce6acd2c3a Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 26 May 2021 11:29:45 -0700 Subject: [PATCH 10/59] Add test-e2e-external-eks make rule --- Makefile | 11 +++++++++++ hack/e2e/eksctl.sh | 24 +++++++++++++++++++++++- hack/e2e/kops.sh | 9 +++++---- hack/e2e/run.sh | 7 +++++-- hack/eksctl-patch.yaml | 9 +++++++++ 5 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 hack/eksctl-patch.yaml diff --git a/Makefile b/Makefile index db65078bc2..20fc23535d 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,17 @@ test-e2e-external: GINKGO_SKIP="\[Disruptive\]|\[Serial\]" \ ./hack/e2e/run.sh +.PHONY: test-e2e-external-eks +test-e2e-external-eks: + CLUSTER_TYPE=eksctl \ + K8S_VERSION="1.19" \ + AWS_REGION=us-west-2 \ + AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b \ + TEST_PATH=./tests/e2e-kubernetes/... \ + GINKGO_FOCUS="External.Storage" \ + GINKGO_SKIP="\[Disruptive\]|\[Serial\]" \ + ./hack/e2e/run.sh + .PHONY: image-release image-release: docker build -t $(IMAGE):$(VERSION) . --target debian-base diff --git a/hack/e2e/eksctl.sh b/hack/e2e/eksctl.sh index 2d96860405..18beff750d 100644 --- a/hack/e2e/eksctl.sh +++ b/hack/e2e/eksctl.sh @@ -20,6 +20,7 @@ function eksctl_create_cluster() { K8S_VERSION=${6} CLUSTER_FILE=${7} KUBECONFIG=${8} + EKSCTL_PATCH_FILE=${9} generate_ssh_key "${SSH_KEY_PATH}" @@ -38,10 +39,11 @@ function eksctl_create_cluster() { --nodes=3 \ --instance-types="${INSTANCE_TYPE}" \ --version="${K8S_VERSION}" \ + --disable-pod-imds \ --dry-run \ "${CLUSTER_NAME}" > "${CLUSTER_FILE}" - # TODO implement patching + eksctl_patch_cluster_file "$CLUSTER_FILE" "$EKSCTL_PATCH_FILE" loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE" ${BIN} create cluster -f "${CLUSTER_FILE}" --kubeconfig "${KUBECONFIG}" @@ -73,3 +75,23 @@ function eksctl_delete_cluster() { loudecho "Deleting cluster ${CLUSTER_NAME}" ${BIN} delete cluster "${CLUSTER_NAME}" } + +function eksctl_patch_cluster_file() { + CLUSTER_FILE=${1} # input must be yaml + EKSCTL_PATCH_FILE=${2} # input must be yaml + + loudecho "Patching cluster $CLUSTER_NAME with $EKSCTL_PATCH_FILE" + + # Temporary intermediate files for patching + CLUSTER_FILE_0=$CLUSTER_FILE.0 + CLUSTER_FILE_1=$CLUSTER_FILE.1 + + cp "$CLUSTER_FILE" "$CLUSTER_FILE_0" + + # Patch only the Cluster + kubectl patch -f "$CLUSTER_FILE_0" --local --type merge --patch "$(cat "$EKSCTL_PATCH_FILE")" -o yaml > "$CLUSTER_FILE_1" + mv "$CLUSTER_FILE_1" "$CLUSTER_FILE_0" + + # Done patching, overwrite original CLUSTER_FILE + mv "$CLUSTER_FILE_0" "$CLUSTER_FILE" # output is yaml +} diff --git a/hack/e2e/kops.sh b/hack/e2e/kops.sh index 40bca20d4f..06fb856a31 100644 --- a/hack/e2e/kops.sh +++ b/hack/e2e/kops.sh @@ -86,10 +86,11 @@ function kops_delete_cluster() { ${BIN} delete cluster --name "${CLUSTER_NAME}" --state "${KOPS_STATE_FILE}" --yes } -# TODO switch this to python, all this hacking with jq stinks! +# TODO switch this to python or work exclusively with yaml, all this +# hacking with jq stinks! function kops_patch_cluster_file() { - CLUSTER_FILE=${1} - KOPS_PATCH_FILE=${2} + CLUSTER_FILE=${1} # input must be json + KOPS_PATCH_FILE=${2} # input must be yaml loudecho "Patching cluster $CLUSTER_NAME with $KOPS_PATCH_FILE" @@ -116,5 +117,5 @@ function kops_patch_cluster_file() { mv "$CLUSTER_FILE_1" "$CLUSTER_FILE_0" # Done patching, overwrite original CLUSTER_FILE - mv "$CLUSTER_FILE_0" "$CLUSTER_FILE" + mv "$CLUSTER_FILE_0" "$CLUSTER_FILE" # output is yaml } diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 3eeac41142..4507e6451e 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -36,7 +36,7 @@ TEST_DIR=${BASE_DIR}/csi-test-artifacts BIN_DIR=${TEST_DIR}/bin SSH_KEY_PATH=${TEST_DIR}/id_rsa CLUSTER_FILE=${TEST_DIR}/${CLUSTER_NAME}.${CLUSTER_TYPE}.json -KUBECONFIG=${KUBECONFIG:-"${TEST_DIR}/${CLUSTER_NAME}.kubeconfig"} +KUBECONFIG=${KUBECONFIG:-"${TEST_DIR}/${CLUSTER_NAME}.${CLUSTER_TYPE}.kubeconfig"} REGION=${AWS_REGION:-us-west-2} ZONES=${AWS_AVAILABILITY_ZONES:-us-west-2a,us-west-2b,us-west-2c} @@ -55,6 +55,8 @@ KOPS_VERSION=${KOPS_VERSION:-1.20.0} KOPS_STATE_FILE=${KOPS_STATE_FILE:-s3://k8s-kops-csi-e2e} KOPS_PATCH_FILE=${KOPS_PATCH_FILE:-./hack/kops-patch.yaml} +EKSCTL_PATCH_FILE=${EKSCTL_PATCH_FILE:-./hack/eksctl-patch.yaml} + HELM_VALUES_FILE=${HELM_VALUES_FILE:-./hack/values.yaml} TEST_PATH=${TEST_PATH:-"./tests/e2e/..."} @@ -127,7 +129,8 @@ elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then "$INSTANCE_TYPE" \ "$K8S_VERSION" \ "$CLUSTER_FILE" \ - "$KUBECONFIG" + "$KUBECONFIG" \ + "$EKSCTL_PATCH_FILE" if [[ $? -ne 0 ]]; then exit 1 fi diff --git a/hack/eksctl-patch.yaml b/hack/eksctl-patch.yaml new file mode 100644 index 0000000000..a8d3e4aa15 --- /dev/null +++ b/hack/eksctl-patch.yaml @@ -0,0 +1,9 @@ +iam: + vpcResourceControllerPolicy: true + withOIDC: true + serviceAccounts: + - metadata: + name: ebs-csi-controller-sa + namespace: kube-system + wellKnownPolicies: + ebsCSIController: true From 236495fdf37bb690aa5979c2131edc74d64cb6ea Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 26 May 2021 16:55:46 -0700 Subject: [PATCH 11/59] Remove hostNetwork from daemonset yamls --- charts/aws-ebs-csi-driver/templates/node.yaml | 1 - deploy/kubernetes/base/node.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index 8e2378106a..556710a39a 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -37,7 +37,6 @@ spec: {{- with .Values.node.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} - hostNetwork: true serviceAccountName: {{ .Values.serviceAccount.node.name }} priorityClassName: {{ .Values.node.priorityClassName | default "system-node-critical" }} tolerations: diff --git a/deploy/kubernetes/base/node.yaml b/deploy/kubernetes/base/node.yaml index e59bd43f38..9894ca7f2a 100644 --- a/deploy/kubernetes/base/node.yaml +++ b/deploy/kubernetes/base/node.yaml @@ -29,7 +29,6 @@ spec: - fargate nodeSelector: kubernetes.io/os: linux - hostNetwork: true serviceAccountName: ebs-csi-node-sa priorityClassName: system-node-critical tolerations: From 1aaedbb7871d68323a2cc2c29a1e9b242b2d07a8 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Thu, 27 May 2021 12:15:35 -0700 Subject: [PATCH 12/59] Don't try to create the controller serviceAccount in helm because eksctl already creates it --- Makefile | 1 + hack/values.yaml | 1 - hack/values_eksctl.yaml | 8 ++++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 hack/values_eksctl.yaml diff --git a/Makefile b/Makefile index 20fc23535d..a46e1d9901 100644 --- a/Makefile +++ b/Makefile @@ -112,6 +112,7 @@ test-e2e-external: test-e2e-external-eks: CLUSTER_TYPE=eksctl \ K8S_VERSION="1.19" \ + HELM_VALUES_FILE="./hack/values_eksctl.yaml" \ AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b \ TEST_PATH=./tests/e2e-kubernetes/... \ diff --git a/hack/values.yaml b/hack/values.yaml index 6d331b8acf..c84cf6e220 100644 --- a/hack/values.yaml +++ b/hack/values.yaml @@ -3,4 +3,3 @@ controller: logLevel: 5 node: logLevel: 5 - diff --git a/hack/values_eksctl.yaml b/hack/values_eksctl.yaml new file mode 100644 index 0000000000..f84eeefad0 --- /dev/null +++ b/hack/values_eksctl.yaml @@ -0,0 +1,8 @@ +enableVolumeSnapshot: true +controller: + logLevel: 5 +node: + logLevel: 5 +serviceAccount: + controller: + create: false # let eksctl create it From bc52c8f71cea9511d657e472cdac8828ba90434a Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 1 Jun 2021 16:34:31 -0700 Subject: [PATCH 13/59] Bump EKS to 1.20 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a46e1d9901..21a3c630bc 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,7 @@ test-e2e-external: .PHONY: test-e2e-external-eks test-e2e-external-eks: CLUSTER_TYPE=eksctl \ - K8S_VERSION="1.19" \ + K8S_VERSION="1.20" \ HELM_VALUES_FILE="./hack/values_eksctl.yaml" \ AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b \ From 38b0165807b103f2949941c4a80a079176a966bf Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 9 Jun 2021 16:12:30 -0700 Subject: [PATCH 14/59] Make helm values, kops patch, and eksctl patch files optional --- hack/e2e/eksctl.sh | 4 +++- hack/e2e/kops.sh | 4 +++- hack/e2e/run.sh | 22 ++++++++++++++-------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/hack/e2e/eksctl.sh b/hack/e2e/eksctl.sh index 18beff750d..e069ec9cd8 100644 --- a/hack/e2e/eksctl.sh +++ b/hack/e2e/eksctl.sh @@ -43,7 +43,9 @@ function eksctl_create_cluster() { --dry-run \ "${CLUSTER_NAME}" > "${CLUSTER_FILE}" - eksctl_patch_cluster_file "$CLUSTER_FILE" "$EKSCTL_PATCH_FILE" + if test -f "$EKSCTL_PATCH_FILE"; then + eksctl_patch_cluster_file "$CLUSTER_FILE" "$EKSCTL_PATCH_FILE" + fi loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE" ${BIN} create cluster -f "${CLUSTER_FILE}" --kubeconfig "${KUBECONFIG}" diff --git a/hack/e2e/kops.sh b/hack/e2e/kops.sh index 06fb856a31..f7fcb487a4 100644 --- a/hack/e2e/kops.sh +++ b/hack/e2e/kops.sh @@ -46,7 +46,9 @@ function kops_create_cluster() { -o json \ "${CLUSTER_NAME}" > "${CLUSTER_FILE}" - kops_patch_cluster_file "$CLUSTER_FILE" "$KOPS_PATCH_FILE" + if test -f "$KOPS_PATCH_FILE"; then + kops_patch_cluster_file "$CLUSTER_FILE" "$KOPS_PATCH_FILE" + fi loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE" ${BIN} create --state "${KOPS_STATE_FILE}" -f "${CLUSTER_FILE}" diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 4507e6451e..fd1c7fef2f 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -138,14 +138,20 @@ fi loudecho "Deploying driver" startSec=$(date +'%s') -"${HELM_BIN}" upgrade --install "${DRIVER_NAME}" \ - --namespace kube-system \ - --set image.repository="${IMAGE_NAME}" \ - --set image.tag="${IMAGE_TAG}" \ - -f "${HELM_VALUES_FILE}" \ - --wait \ - --kubeconfig "${KUBECONFIG}" \ - ./charts/"${DRIVER_NAME}" + +HELM_ARGS=(upgrade --install "${DRIVER_NAME}" + --namespace kube-system + --set image.repository="${IMAGE_NAME}" + --set image.tag="${IMAGE_TAG}" + --wait + --kubeconfig "${KUBECONFIG}" + ./charts/"${DRIVER_NAME}") +if test -f "$HELM_VALUES_FILE"; then + HELM_ARGS+=(-f "${HELM_VALUES_FILE}") +fi +set -x +"${HELM_BIN}" "${HELM_ARGS[@]}" +set +x if [[ -r "${EBS_SNAPSHOT_CRD}" ]]; then loudecho "Deploying snapshot CRD" From 3c8119f1846f6b6215bb3c27618861c1e2fed2f7 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 11 Jun 2021 13:08:41 -0700 Subject: [PATCH 15/59] Add KubernetesCluster tag to provisioned volumes when cluster-id set --- pkg/driver/constants.go | 5 +++++ pkg/driver/controller.go | 1 + pkg/driver/controller_test.go | 24 +++++++++++++----------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/pkg/driver/constants.go b/pkg/driver/constants.go index 503ec2bee4..43028b57eb 100644 --- a/pkg/driver/constants.go +++ b/pkg/driver/constants.go @@ -86,6 +86,11 @@ const ( // in-tree volume plugin. Used only when --cluster-id is set. NameTag = "Name" + // KubernetesClusterTag is tag applied to provisioned EBS volume for backward compatibility with + // in-tree volume plugin. Used only when --cluster-id is set. + // See https://github.com/kubernetes/cloud-provider-aws/blob/release-1.20/pkg/providers/v1/tags.go#L38-L41. + KubernetesClusterTag = "KubernetesCluster" + // PVCNameTag is tag applied to provisioned EBS volume for backward compatibility // with in-tree volume plugin. Value of the tag is PVC name. It is applied only when // the external provisioner sidecar is started with --extra-create-metadata=true and diff --git a/pkg/driver/controller.go b/pkg/driver/controller.go index 21f37eb97f..9825e90908 100644 --- a/pkg/driver/controller.go +++ b/pkg/driver/controller.go @@ -220,6 +220,7 @@ func (d *controllerService) CreateVolume(ctx context.Context, req *csi.CreateVol resourceLifecycleTag := ResourceLifecycleTagPrefix + d.driverOptions.kubernetesClusterID volumeTags[resourceLifecycleTag] = ResourceLifecycleOwned volumeTags[NameTag] = d.driverOptions.kubernetesClusterID + "-dynamic-" + volName + volumeTags[KubernetesClusterTag] = d.driverOptions.kubernetesClusterID } for k, v := range d.driverOptions.extraTags { volumeTags[k] = v diff --git a/pkg/driver/controller_test.go b/pkg/driver/controller_test.go index ca2f96115a..c9187e8d3e 100644 --- a/pkg/driver/controller_test.go +++ b/pkg/driver/controller_test.go @@ -1356,12 +1356,14 @@ func TestCreateVolume(t *testing.T) { name: "success with cluster-id", testFunc: func(t *testing.T) { const ( - volumeName = "random-vol-name" - clusterID = "test-cluster-id" - expectedOwnerTag = "kubernetes.io/cluster/test-cluster-id" - expectedOwnerTagValue = "owned" - expectedNameTag = "Name" - expectedNameTagValue = "test-cluster-id-dynamic-random-vol-name" + volumeName = "random-vol-name" + clusterID = "test-cluster-id" + expectedOwnerTag = "kubernetes.io/cluster/test-cluster-id" + expectedOwnerTagValue = "owned" + expectedNameTag = "Name" + expectedNameTagValue = "test-cluster-id-dynamic-random-vol-name" + expectedKubernetesClusterTag = "KubernetesCluster" + expectedKubernetesClusterTagValue = "test-cluster-id" ) req := &csi.CreateVolumeRequest{ Name: volumeName, @@ -1381,10 +1383,11 @@ func TestCreateVolume(t *testing.T) { diskOptions := &cloud.DiskOptions{ CapacityBytes: stdVolSize, Tags: map[string]string{ - cloud.VolumeNameTagKey: volumeName, - cloud.AwsEbsDriverTagKey: "true", - expectedOwnerTag: expectedOwnerTagValue, - expectedNameTag: expectedNameTagValue, + cloud.VolumeNameTagKey: volumeName, + cloud.AwsEbsDriverTagKey: "true", + expectedOwnerTag: expectedOwnerTagValue, + expectedNameTag: expectedNameTagValue, + expectedKubernetesClusterTag: expectedKubernetesClusterTagValue, }, } @@ -1418,7 +1421,6 @@ func TestCreateVolume(t *testing.T) { testFunc: func(t *testing.T) { const ( volumeName = "random-vol-name" - clusterID = "test-cluster-id" expectedPVCNameTag = "kubernetes.io/created-for/pvc/name" expectedPVCNamespaceTag = "kubernetes.io/created-for/pvc/namespace" expectedPVNameTag = "kubernetes.io/created-for/pv/name" From 6fdb52a360dbb9b2fe9a50b03613968263582de7 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 11 Jun 2021 15:07:18 -0700 Subject: [PATCH 16/59] Grant EKSCTL_ADMIN_ROLE admin access to eksctl clusters --- Makefile | 1 + hack/e2e/eksctl.sh | 9 +++++++++ hack/e2e/run.sh | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 21a3c630bc..91781e98c7 100644 --- a/Makefile +++ b/Makefile @@ -113,6 +113,7 @@ test-e2e-external-eks: CLUSTER_TYPE=eksctl \ K8S_VERSION="1.20" \ HELM_VALUES_FILE="./hack/values_eksctl.yaml" \ + EKSCTL_ADMIN_ROLE="Infra-prod-KopsDeleteAllLambdaServiceRoleF1578477-1ELDFIB4KCMXV" \ AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b \ TEST_PATH=./tests/e2e-kubernetes/... \ diff --git a/hack/e2e/eksctl.sh b/hack/e2e/eksctl.sh index e069ec9cd8..a4c7f2011b 100644 --- a/hack/e2e/eksctl.sh +++ b/hack/e2e/eksctl.sh @@ -21,6 +21,7 @@ function eksctl_create_cluster() { CLUSTER_FILE=${7} KUBECONFIG=${8} EKSCTL_PATCH_FILE=${9} + EKSCTL_ADMIN_ROLE=${10} generate_ssh_key "${SSH_KEY_PATH}" @@ -55,6 +56,14 @@ function eksctl_create_cluster() { loudecho "Getting cluster ${CLUSTER_NAME}" ${BIN} get cluster "${CLUSTER_NAME}" + + if [ -n "$EKSCTL_ADMIN_ROLE" ]; then + AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) + ADMIN_ARN="arn:aws:iam::${AWS_ACCOUNT_ID}:role/${EKSCTL_ADMIN_ROLE}" + loudecho "Granting ${ADMIN_ARN} admin access to the cluster" + ${BIN} create iamidentitymapping --cluster "${CLUSTER_NAME}" --arn "${ADMIN_ARN}" --group system:masters --username admin + fi + return $? } diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index fd1c7fef2f..d6a5ec34e3 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -56,6 +56,7 @@ KOPS_STATE_FILE=${KOPS_STATE_FILE:-s3://k8s-kops-csi-e2e} KOPS_PATCH_FILE=${KOPS_PATCH_FILE:-./hack/kops-patch.yaml} EKSCTL_PATCH_FILE=${EKSCTL_PATCH_FILE:-./hack/eksctl-patch.yaml} +EKSCTL_ADMIN_ROLE=${EKSCTL_ADMIN_ROLE:-} HELM_VALUES_FILE=${HELM_VALUES_FILE:-./hack/values.yaml} @@ -130,7 +131,8 @@ elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then "$K8S_VERSION" \ "$CLUSTER_FILE" \ "$KUBECONFIG" \ - "$EKSCTL_PATCH_FILE" + "$EKSCTL_PATCH_FILE" \ + "$EKSCTL_ADMIN_ROLE" if [[ $? -ne 0 ]]; then exit 1 fi From 9098337f0e2bdfae15c78e6686cb3ee9f20c9e6c Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Mon, 14 Jun 2021 15:17:38 -0700 Subject: [PATCH 17/59] Patch Node InstanceGroup, set Node count --- hack/e2e/kops.sh | 80 +++++++++++++++++++++++++++++++++--------------- hack/e2e/run.sh | 6 +++- 2 files changed, 61 insertions(+), 25 deletions(-) diff --git a/hack/e2e/kops.sh b/hack/e2e/kops.sh index f7fcb487a4..ef12d5ba56 100644 --- a/hack/e2e/kops.sh +++ b/hack/e2e/kops.sh @@ -22,12 +22,14 @@ function kops_create_cluster() { CLUSTER_NAME=${2} BIN=${3} ZONES=${4} - INSTANCE_TYPE=${5} - K8S_VERSION=${6} - CLUSTER_FILE=${7} - KUBECONFIG=${8} - KOPS_PATCH_FILE=${9} - KOPS_STATE_FILE=${10} + NODE_COUNT=${5} + INSTANCE_TYPE=${6} + K8S_VERSION=${7} + CLUSTER_FILE=${8} + KUBECONFIG=${9} + KOPS_PATCH_FILE=${10} + KOPS_PATCH_NODE_FILE=${11} + KOPS_STATE_FILE=${12} generate_ssh_key "${SSH_KEY_PATH}" @@ -39,15 +41,18 @@ function kops_create_cluster() { ${BIN} create cluster --state "${KOPS_STATE_FILE}" \ --ssh-public-key="${SSH_KEY_PATH}".pub \ --zones "${ZONES}" \ - --node-count=3 \ + --node-count="${NODE_COUNT}" \ --node-size="${INSTANCE_TYPE}" \ --kubernetes-version="${K8S_VERSION}" \ --dry-run \ - -o json \ + -o yaml \ "${CLUSTER_NAME}" > "${CLUSTER_FILE}" if test -f "$KOPS_PATCH_FILE"; then - kops_patch_cluster_file "$CLUSTER_FILE" "$KOPS_PATCH_FILE" + kops_patch_cluster_file "$CLUSTER_FILE" "$KOPS_PATCH_FILE" "Cluster" "" + fi + if test -f "$KOPS_PATCH_NODE_FILE"; then + kops_patch_cluster_file "$CLUSTER_FILE" "$KOPS_PATCH_NODE_FILE" "InstanceGroup" "Node" fi loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE" @@ -88,36 +93,63 @@ function kops_delete_cluster() { ${BIN} delete cluster --name "${CLUSTER_NAME}" --state "${KOPS_STATE_FILE}" --yes } -# TODO switch this to python or work exclusively with yaml, all this -# hacking with jq stinks! +# TODO switch this to python, work exclusively with yaml, use kops toolbox +# template/kops set?, all this hacking with jq stinks! function kops_patch_cluster_file() { - CLUSTER_FILE=${1} # input must be json + CLUSTER_FILE=${1} # input must be yaml KOPS_PATCH_FILE=${2} # input must be yaml + KIND=${3} # must be either Cluster or InstanceGroup + ROLE=${4} # must be either Master or Node loudecho "Patching cluster $CLUSTER_NAME with $KOPS_PATCH_FILE" - # Temporary intermediate files for patching + # Temporary intermediate files for patching, don't mutate CLUSTER_FILE until + # the end + CLUSTER_FILE_JSON=$CLUSTER_FILE.json CLUSTER_FILE_0=$CLUSTER_FILE.0 CLUSTER_FILE_1=$CLUSTER_FILE.1 - # Output is an array of Cluster and InstanceGroups - jq '.[] | select(.kind=="Cluster")' "$CLUSTER_FILE" > "$CLUSTER_FILE_0" + # HACK convert the multiple yaml documents to an array of json objects + yaml_to_json "$CLUSTER_FILE" "$CLUSTER_FILE_JSON" + + # Find the json objects to patch + FILTER=".[] | select(.kind==\"$KIND\")" + if [ -n "$ROLE" ]; then + FILTER="$FILTER | select(.spec.role==\"$ROLE\")" + fi + jq "$FILTER" "$CLUSTER_FILE_JSON" > "$CLUSTER_FILE_0" - # Patch only the Cluster + # Patch only the json objects kubectl patch -f "$CLUSTER_FILE_0" --local --type merge --patch "$(cat "$KOPS_PATCH_FILE")" -o json > "$CLUSTER_FILE_1" mv "$CLUSTER_FILE_1" "$CLUSTER_FILE_0" - # Write the patched Cluster back to the array - jq '(.[] | select(.kind=="Cluster")) = $cluster[0]' "$CLUSTER_FILE" --slurpfile cluster "$CLUSTER_FILE_0" > "$CLUSTER_FILE_1" + # Delete the original json objects, add the patched + # TODO Cluster must always be first? + jq "del($FILTER)" "$CLUSTER_FILE_JSON" | jq ". + \$patched | sort" --slurpfile patched "$CLUSTER_FILE_0" > "$CLUSTER_FILE_1" mv "$CLUSTER_FILE_1" "$CLUSTER_FILE_0" - # HACK convert the json array to multiple yaml documents - for ((i = 0; i < $(jq length "$CLUSTER_FILE_0"); i++)); do - echo "---" >> "$CLUSTER_FILE_1" - jq ".[$i]" "$CLUSTER_FILE_0" | kubectl patch -f - --local -p "{}" --type merge -o yaml >> "$CLUSTER_FILE_1" - done + # HACK convert the array of json objects to multiple yaml documents + json_to_yaml "$CLUSTER_FILE_0" "$CLUSTER_FILE_1" mv "$CLUSTER_FILE_1" "$CLUSTER_FILE_0" - # Done patching, overwrite original CLUSTER_FILE + # Done patching, overwrite original yaml CLUSTER_FILE mv "$CLUSTER_FILE_0" "$CLUSTER_FILE" # output is yaml + + # Clean up + rm "$CLUSTER_FILE_JSON" +} + +function yaml_to_json() { + IN=${1} + OUT=${2} + kubectl patch -f "$IN" --local -p "{}" --type merge -o json | jq '.' -s > "$OUT" +} + +function json_to_yaml() { + IN=${1} + OUT=${2} + for ((i = 0; i < $(jq length "$IN"); i++)); do + echo "---" >> "$OUT" + jq ".[$i]" "$IN" | kubectl patch -f - --local -p "{}" --type merge -o yaml >> "$OUT" + done } diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index d6a5ec34e3..27035041e7 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -35,12 +35,13 @@ CLUSTER_TYPE=${CLUSTER_TYPE:-kops} TEST_DIR=${BASE_DIR}/csi-test-artifacts BIN_DIR=${TEST_DIR}/bin SSH_KEY_PATH=${TEST_DIR}/id_rsa -CLUSTER_FILE=${TEST_DIR}/${CLUSTER_NAME}.${CLUSTER_TYPE}.json +CLUSTER_FILE=${TEST_DIR}/${CLUSTER_NAME}.${CLUSTER_TYPE}.yaml KUBECONFIG=${KUBECONFIG:-"${TEST_DIR}/${CLUSTER_NAME}.${CLUSTER_TYPE}.kubeconfig"} REGION=${AWS_REGION:-us-west-2} ZONES=${AWS_AVAILABILITY_ZONES:-us-west-2a,us-west-2b,us-west-2c} FIRST_ZONE=$(echo "${ZONES}" | cut -d, -f1) +NODE_COUNT=${NODE_COUNT:-3} INSTANCE_TYPE=${INSTANCE_TYPE:-c4.large} AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) @@ -54,6 +55,7 @@ K8S_VERSION=${K8S_VERSION:-1.20.6} KOPS_VERSION=${KOPS_VERSION:-1.20.0} KOPS_STATE_FILE=${KOPS_STATE_FILE:-s3://k8s-kops-csi-e2e} KOPS_PATCH_FILE=${KOPS_PATCH_FILE:-./hack/kops-patch.yaml} +KOPS_PATCH_NODE_FILE=${KOPS_PATCH_NODE_FILE:-./hack/kops-patch-node.yaml} EKSCTL_PATCH_FILE=${EKSCTL_PATCH_FILE:-./hack/eksctl-patch.yaml} EKSCTL_ADMIN_ROLE=${EKSCTL_ADMIN_ROLE:-} @@ -112,11 +114,13 @@ if [[ "${CLUSTER_TYPE}" == "kops" ]]; then "$CLUSTER_NAME" \ "$KOPS_BIN" \ "$ZONES" \ + "$NODE_COUNT" \ "$INSTANCE_TYPE" \ "$K8S_VERSION" \ "$CLUSTER_FILE" \ "$KUBECONFIG" \ "$KOPS_PATCH_FILE" \ + "$KOPS_PATCH_NODE_FILE" \ "$KOPS_STATE_FILE" if [[ $? -ne 0 ]]; then exit 1 From 5e9fb1051f43d340f38a5fd3d8024e78da246dfe Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 15 Jun 2021 13:13:39 -0700 Subject: [PATCH 18/59] Fix check for whether test docker image has been built --- hack/e2e/ecr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/e2e/ecr.sh b/hack/e2e/ecr.sh index 8f710d95be..df7b973b71 100644 --- a/hack/e2e/ecr.sh +++ b/hack/e2e/ecr.sh @@ -11,7 +11,7 @@ function ecr_build_and_push() { IMAGE_NAME=${3} IMAGE_TAG=${4} set +e - if docker images | grep "${IMAGE_NAME}" | grep "${IMAGE_TAG}"; then + if docker images --format "{{.Repository}}:{{.Tag}}" | grep "${IMAGE_NAME}:${IMAGE_TAG}"; then set -e loudecho "Assuming ${IMAGE_NAME}:${IMAGE_TAG} has been built and pushed" else From 9febc3ea084a83e1f5d5c9813a9f789515851301 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 15 Jun 2021 13:56:40 -0700 Subject: [PATCH 19/59] Default extra-create-metadata true so that volumes get created with pvc/pv tags --- charts/aws-ebs-csi-driver/values.yaml | 2 +- deploy/kubernetes/base/controller.yaml | 3 ++- deploy/kubernetes/base/node.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 4a59f08863..243e97fa40 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -46,7 +46,7 @@ enableVolumeSnapshot: false # Moving to values under controller affinity: {} -extraCreateMetadata: false +extraCreateMetadata: true extraVolumeTags: {} k8sTagClusterId: nodeSelector: {} diff --git a/deploy/kubernetes/base/controller.yaml b/deploy/kubernetes/base/controller.yaml index d38e1fdc90..9889a0276d 100644 --- a/deploy/kubernetes/base/controller.yaml +++ b/deploy/kubernetes/base/controller.yaml @@ -31,7 +31,7 @@ spec: tolerationSeconds: 300 containers: - name: ebs-plugin - image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.0.0 + image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.0 imagePullPolicy: IfNotPresent args: # - {all,controller,node} # specify the driver mode @@ -86,6 +86,7 @@ spec: - --csi-address=$(ADDRESS) - --v=5 - --feature-gates=Topology=true + - --extra-create-metadata - --leader-election=true - --default-fstype=ext4 env: diff --git a/deploy/kubernetes/base/node.yaml b/deploy/kubernetes/base/node.yaml index 9894ca7f2a..1ef6eba112 100644 --- a/deploy/kubernetes/base/node.yaml +++ b/deploy/kubernetes/base/node.yaml @@ -41,7 +41,7 @@ spec: - name: ebs-plugin securityContext: privileged: true - image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.0.0 + image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.0 args: - node - --endpoint=$(CSI_ENDPOINT) From 0d9117497c0dc56d50cc62dfac7fc5468c73193f Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 16 Jun 2021 14:12:25 -0700 Subject: [PATCH 20/59] Default controller.extra-create-metadata true so that volumes get created with pvc/pv tags --- charts/aws-ebs-csi-driver/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 243e97fa40..a33fda9db4 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -68,7 +68,7 @@ controller: snapshotter: [] resizer: [] # If set, add pv/pvc metadata to plugin create requests as parameters. - extraCreateMetadata: false + extraCreateMetadata: true # Will be removed in later version in favor of env.ebsPlugin extraVars: {} # Extra volume tags to attach to each dynamically provisioned volume. From d8587da38ec3061c43177b05f591f381baae1c46 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 16 Jun 2021 14:45:51 -0700 Subject: [PATCH 21/59] Bump helm chart to 1.2.3 --- charts/aws-ebs-csi-driver/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index fe9174e802..003c573ce5 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.1.0" name: aws-ebs-csi-driver description: A Helm chart for AWS EBS CSI Driver -version: 1.2.2 +version: 1.2.3 kubeVersion: ">=1.17.0-0" home: https://github.com/kubernetes-sigs/aws-ebs-csi-driver sources: From 9ced0445b32888f5d9121d8d1662df0b8d26bcc6 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 16 Jun 2021 13:55:19 -0700 Subject: [PATCH 22/59] Exercise example policy in tests --- hack/kops-patch.yaml | 112 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 104 insertions(+), 8 deletions(-) diff --git a/hack/kops-patch.yaml b/hack/kops-patch.yaml index 0fa34e5e1d..1349bab898 100644 --- a/hack/kops-patch.yaml +++ b/hack/kops-patch.yaml @@ -5,22 +5,118 @@ spec: { "Effect": "Allow", "Action": [ - "ec2:AttachVolume", "ec2:CreateSnapshot", - "ec2:CreateTags", - "ec2:CreateVolume", - "ec2:DeleteSnapshot", - "ec2:DeleteTags", - "ec2:DeleteVolume", + "ec2:AttachVolume", + "ec2:DetachVolume", + "ec2:ModifyVolume", + "ec2:DescribeAvailabilityZones", "ec2:DescribeInstances", "ec2:DescribeSnapshots", "ec2:DescribeTags", "ec2:DescribeVolumes", - "ec2:DetachVolume", - "ec2:ModifyVolume", "ec2:DescribeVolumesModifications" ], "Resource": "*" + }, + { + "Effect": "Allow", + "Action": [ + "ec2:CreateTags" + ], + "Resource": [ + "arn:aws:ec2:*:*:volume/*", + "arn:aws:ec2:*:*:snapshot/*" + ], + "Condition": { + "StringEquals": { + "ec2:CreateAction": [ + "CreateVolume", + "CreateSnapshot" + ] + } + } + }, + { + "Effect": "Allow", + "Action": [ + "ec2:DeleteTags" + ], + "Resource": [ + "arn:aws:ec2:*:*:volume/*", + "arn:aws:ec2:*:*:snapshot/*" + ] + }, + { + "Effect": "Allow", + "Action": [ + "ec2:CreateVolume" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "aws:RequestTag/ebs.csi.aws.com/cluster": "true" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "ec2:CreateVolume" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "aws:RequestTag/CSIVolumeName": "*" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "ec2:DeleteVolume" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "ec2:ResourceTag/CSIVolumeName": "*" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "ec2:DeleteVolume" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "ec2:DeleteSnapshot" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "ec2:ResourceTag/CSIVolumeSnapshotName": "*" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "ec2:DeleteSnapshot" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" + } + } } ] kubeAPIServer: From 74da18e7ac07e3c2911a3deb0b454f1d0de6bd4f Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 16 Jun 2021 14:38:22 -0700 Subject: [PATCH 23/59] Set k8s-tag-cluster-id to non-empty value in tests so that CSI tags volumes with in-tree tags --- hack/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/values.yaml b/hack/values.yaml index c84cf6e220..6d219e1f91 100644 --- a/hack/values.yaml +++ b/hack/values.yaml @@ -1,5 +1,6 @@ enableVolumeSnapshot: true controller: + k8sTagClusterId: test logLevel: 5 node: logLevel: 5 From 59a0bb134df871efd91db66ea530d943cfc83588 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 16 Jun 2021 14:57:39 -0700 Subject: [PATCH 24/59] Add permission to Create/Delete ec2:ResourceTag/kubernetes.io/cluster/* volumes so that CSI can Delete KCM-created volumes --- docs/example-iam-policy.json | 28 ++++++++++++++++++++++++++-- hack/kops-patch.yaml | 26 +++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/docs/example-iam-policy.json b/docs/example-iam-policy.json index e1c2354bfb..e48432ef92 100644 --- a/docs/example-iam-policy.json +++ b/docs/example-iam-policy.json @@ -69,6 +69,30 @@ } } }, + { + "Effect": "Allow", + "Action": [ + "ec2:CreateVolume" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "aws:RequestTag/kubernetes.io/cluster/*": "owned" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "ec2:DeleteVolume" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" + } + } + }, { "Effect": "Allow", "Action": [ @@ -89,7 +113,7 @@ "Resource": "*", "Condition": { "StringLike": { - "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" + "ec2:ResourceTag/kubernetes.io/cluster/*": "owned" } } }, @@ -118,4 +142,4 @@ } } ] -} \ No newline at end of file +} diff --git a/hack/kops-patch.yaml b/hack/kops-patch.yaml index 1349bab898..7475ca50bd 100644 --- a/hack/kops-patch.yaml +++ b/hack/kops-patch.yaml @@ -70,6 +70,30 @@ spec: } } }, + { + "Effect": "Allow", + "Action": [ + "ec2:CreateVolume" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "aws:RequestTag/kubernetes.io/cluster/*": "owned" + } + } + }, + { + "Effect": "Allow", + "Action": [ + "ec2:DeleteVolume" + ], + "Resource": "*", + "Condition": { + "StringLike": { + "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" + } + } + }, { "Effect": "Allow", "Action": [ @@ -90,7 +114,7 @@ spec: "Resource": "*", "Condition": { "StringLike": { - "ec2:ResourceTag/ebs.csi.aws.com/cluster": "true" + "ec2:ResourceTag/kubernetes.io/cluster/*": "owned" } } }, From 3496317244159e4fe3e7ec3fc75d9f5f19900735 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 16 Jun 2021 16:40:39 -0700 Subject: [PATCH 25/59] Update README to say the CSI needs permission to Delete KCM-created volumes --- docs/README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/README.md b/docs/README.md index 5ef60d1814..f99180ddc1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -130,22 +130,18 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll ## Installation #### Set up driver permission -The driver requires IAM permission to talk to Amazon EBS to manage the volume on user's behalf. There are several methods to grant driver IAM permission: -* Using secret object - create an IAM user with proper permission, put that user's credentials in [secret manifest](../deploy/kubernetes/secret.yaml) then deploy the secret. +The driver requires IAM permission to talk to Amazon EBS to manage the volume on user's behalf. [The example policy here](./example-iam-policy.json) defines these permissions. There are several methods to grant the driver IAM permission: +* Using IAM [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) - attach the policy to the instance profile IAM role for the instance(s) on which the driver Deployment will run +* EKS only: Using [IAM roles for ServiceAccounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) - create an IAM role, attach the policy to it, then follow the IRSA documentation to associate the IAM role with the driver Deployment service account, which if you are installing via helm is determined by value `serviceAccount.controller.name`, `ebs-csi-controller-sa` by default +* Using secret object - create an IAM user, attach the policy to it, put that user's credentials in [secret manifest](../deploy/kubernetes/secret.yaml), then deploy the secret ```sh curl https://raw.githubusercontent.com/kubernetes-sigs/aws-ebs-csi-driver/master/deploy/kubernetes/secret.yaml > secret.yaml # Edit the secret with user credentials kubectl apply -f secret.yaml ``` -* Using IAM [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) - grant all the worker nodes with [proper permission](./example-iam-policy.json) by attaching policy to the instance profile of the worker. -#### Deploy CRD (optional) -If your cluster is v1.14+, you can skip this step. Install the `CSINodeInfo` CRD on the cluster: -```sh -kubectl create -f https://raw.githubusercontent.com/kubernetes/csi-api/release-1.13/pkg/crd/manifests/csinodeinfo.yaml -``` #### Config node toleration settings -By default, driver tolerates taint `CriticalAddonsOnly` and has `tolerationSeconds` configured as `300`, to deploy the driver on any nodes, please set helm `Value.node.tolerateAllTaints` to true before deployment +By default, driver tolerates taint `CriticalAddonsOnly` and has `tolerationSeconds` configured as `300`, to deploy the driver on all nodes, please set helm `Value.node.tolerateAllTaints` to true before deployment #### Deploy driver Please see the compatibility matrix above before you deploy the driver @@ -195,12 +191,14 @@ Make sure you follow the [Prerequisites](README.md#Prerequisites) before the exa ## Migrating from in-tree EBS plugin -Starting from Kubernetes 1.17, CSI migration is supported as beta feature (alpha since 1.14). If you have persistence volumes that are created with in-tree `kubernetes.io/aws-ebs` plugin, you could migrate to use EBS CSI driver. To turn on the migration, drain the node and set `CSIMigration` and `CSIMigrationAWS` feature gates to `true` for `kube-controller-manager` and `kubelet`. +Starting from Kubernetes 1.17, CSI migration is supported as beta feature (alpha since 1.14). If you have persistent volumes that are created with in-tree `kubernetes.io/aws-ebs` plugin, you can migrate to use EBS CSI driver. To turn on the migration, set `CSIMigration` and `CSIMigrationAWS` feature gates to `true` for `kube-controller-manager`. Then drain Nodes and set the same feature gates to `true` for `kubelet`. To make sure dynamically provisioned EBS volumes have all tags that the in-tree volume plugin used: -* Run the external-provisioner sidecar with `--extra-create-metadata=true` cmdline option. External-provisioner v1.6 or newer is required. +* Run the external-provisioner sidecar with `--extra-create-metadata=true` cmdline option. The helm chart sets this option true by default. * Run the CSI driver with `--k8s-tag-cluster-id=` command line option. +To make sure that the CSI driver has permission to Attach, Detach, and Delete volumes that were dynamically provisioned and tagged by the in-tree plugin prior to migration being turned on, the IAM policy has to grant permission to operate on volumes with tag `kubernetes.io/cluster/": "owned"` like in [the example policy](./example-iam-policy.json#L85). + **Warning**: * kubelet *must* be drained of all pods with mounted EBS volumes ***before*** changing its CSI migration feature flags. Failure to do this will cause deleted pods to get stuck in `Terminating`, requiring a forced delete which can cause filesystem corruption. See [#679](../../../issues/679) for more details. From 3abc1afa8dd30768cac712359505b8200ca2e72c Mon Sep 17 00:00:00 2001 From: Ricardo Rosales Date: Thu, 17 Jun 2021 16:14:52 -0500 Subject: [PATCH 26/59] Adding CRDs VolumeSnapshotClass, VolumeSnapshotContent, VolumeSnapshot for snapshot.storage.k8s.io/v1 to helm chart --- Makefile | 1 + .../aws-ebs-csi-driver/crds/snapshot-controller.yaml | 0 charts/aws-ebs-csi-driver/templates/crds.yml | 6 ++++++ hack/e2e/run.sh | 6 ------ 4 files changed, 7 insertions(+), 6 deletions(-) rename deploy/kubernetes/cluster/crd_snapshotter.yaml => charts/aws-ebs-csi-driver/crds/snapshot-controller.yaml (100%) create mode 100644 charts/aws-ebs-csi-driver/templates/crds.yml diff --git a/Makefile b/Makefile index 21a3c630bc..7fe4c46c10 100644 --- a/Makefile +++ b/Makefile @@ -175,3 +175,4 @@ generate-kustomize: bin/helm cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-csi-node.yaml > ../../deploy/kubernetes/base/serviceaccount-csi-node.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-snapshot-controller.yaml > ../../deploy/kubernetes/base/serviceaccount-snapshot-controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/snapshot-controller.yaml -f ../../deploy/kubernetes/values/snapshotter.yaml > ../../deploy/kubernetes/base/snapshot_controller.yaml + cd charts/aws-ebs-csi-driver && mkdir -p ../../deploy/kubernetes/cluster && cp crds/snapshot-controller.yaml ../../deploy/kubernetes/cluster/crd_snapshotter.yaml diff --git a/deploy/kubernetes/cluster/crd_snapshotter.yaml b/charts/aws-ebs-csi-driver/crds/snapshot-controller.yaml similarity index 100% rename from deploy/kubernetes/cluster/crd_snapshotter.yaml rename to charts/aws-ebs-csi-driver/crds/snapshot-controller.yaml diff --git a/charts/aws-ebs-csi-driver/templates/crds.yml b/charts/aws-ebs-csi-driver/templates/crds.yml new file mode 100644 index 0000000000..ebd5f49e6a --- /dev/null +++ b/charts/aws-ebs-csi-driver/templates/crds.yml @@ -0,0 +1,6 @@ +{{- if and .Values.enableVolumeSnapshot (ne (.Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1") true) }} +{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }} +{{ $.Files.Get $path }} +--- +{{- end }} +{{- end }} diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index fd1c7fef2f..0be2615506 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -153,12 +153,6 @@ set -x "${HELM_BIN}" "${HELM_ARGS[@]}" set +x -if [[ -r "${EBS_SNAPSHOT_CRD}" ]]; then - loudecho "Deploying snapshot CRD" - kubectl apply -f "$EBS_SNAPSHOT_CRD" \ - --kubeconfig "${KUBECONFIG}" - # TODO deploy snapshot controller too instead of including in helm chart -fi endSec=$(date +'%s') secondUsed=$(((endSec - startSec) / 1)) # Set timeout threshold as 20 seconds for now, usually it takes less than 10s to startup From 7aed0f2e5560f34f1d3e869e2d9e277ab771feb8 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 18 Jun 2021 14:24:42 -0700 Subject: [PATCH 27/59] Set actual cluster name as k8s-tag-cluster-id instead of dummy value --- Makefile | 5 +++++ hack/e2e/run.sh | 4 +++- hack/values.yaml | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 91781e98c7..1d793141a9 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,7 @@ test-sanity: test-e2e-single-az: AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a \ + HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ TEST_PATH=./tests/e2e/... \ GINKGO_FOCUS="\[ebs-csi-e2e\] \[single-az\]" \ GINKGO_SKIP="\"sc1\"|\"st1\"" \ @@ -86,6 +87,7 @@ test-e2e-single-az: test-e2e-multi-az: AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \ + HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ TEST_PATH=./tests/e2e/... \ GINKGO_FOCUS="\[ebs-csi-e2e\] \[multi-az\]" \ ./hack/e2e/run.sh @@ -94,6 +96,7 @@ test-e2e-multi-az: test-e2e-migration: AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \ + HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ TEST_PATH=./tests/e2e-kubernetes/... \ GINKGO_FOCUS="\[ebs-csi-migration\]" \ EBS_CHECK_MIGRATION=true \ @@ -103,6 +106,7 @@ test-e2e-migration: test-e2e-external: AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \ + HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ TEST_PATH=./tests/e2e-kubernetes/... \ GINKGO_FOCUS="External.Storage" \ GINKGO_SKIP="\[Disruptive\]|\[Serial\]" \ @@ -113,6 +117,7 @@ test-e2e-external-eks: CLUSTER_TYPE=eksctl \ K8S_VERSION="1.20" \ HELM_VALUES_FILE="./hack/values_eksctl.yaml" \ + HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ EKSCTL_ADMIN_ROLE="Infra-prod-KopsDeleteAllLambdaServiceRoleF1578477-1ELDFIB4KCMXV" \ AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b \ diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 27035041e7..a454dbfba0 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -61,6 +61,7 @@ EKSCTL_PATCH_FILE=${EKSCTL_PATCH_FILE:-./hack/eksctl-patch.yaml} EKSCTL_ADMIN_ROLE=${EKSCTL_ADMIN_ROLE:-} HELM_VALUES_FILE=${HELM_VALUES_FILE:-./hack/values.yaml} +HELM_EXTRA_FLAGS=${HELM_EXTRA_FLAGS:-} TEST_PATH=${TEST_PATH:-"./tests/e2e/..."} ARTIFACTS=${ARTIFACTS:-"${TEST_DIR}/artifacts"} @@ -155,8 +156,9 @@ HELM_ARGS=(upgrade --install "${DRIVER_NAME}" if test -f "$HELM_VALUES_FILE"; then HELM_ARGS+=(-f "${HELM_VALUES_FILE}") fi +eval "EXPANDED_HELM_EXTRA_FLAGS=$HELM_EXTRA_FLAGS" set -x -"${HELM_BIN}" "${HELM_ARGS[@]}" +"${HELM_BIN}" "${HELM_ARGS[@]}" "${EXPANDED_HELM_EXTRA_FLAGS}" set +x if [[ -r "${EBS_SNAPSHOT_CRD}" ]]; then diff --git a/hack/values.yaml b/hack/values.yaml index 6d219e1f91..c84cf6e220 100644 --- a/hack/values.yaml +++ b/hack/values.yaml @@ -1,6 +1,5 @@ enableVolumeSnapshot: true controller: - k8sTagClusterId: test logLevel: 5 node: logLevel: 5 From b40a0a2670472d292ce22d6fafe58f6b3f5443ea Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 8 Jun 2021 16:39:40 -0700 Subject: [PATCH 28/59] Add migration upgrade/downgrade test --- tests/e2e-upgrade/README.md | 1 + tests/e2e-upgrade/e2e_test.go | 394 ++++++++++++++++++++++++++++++++++ tests/e2e-upgrade/kops.go | 170 +++++++++++++++ 3 files changed, 565 insertions(+) create mode 100644 tests/e2e-upgrade/README.md create mode 100644 tests/e2e-upgrade/e2e_test.go create mode 100644 tests/e2e-upgrade/kops.go diff --git a/tests/e2e-upgrade/README.md b/tests/e2e-upgrade/README.md new file mode 100644 index 0000000000..a187cb5172 --- /dev/null +++ b/tests/e2e-upgrade/README.md @@ -0,0 +1 @@ +Test the AWS EBS CSI driver before/during/after the CSIMigration and CSIMigrationAWS features are enabled/disabled. For details see (https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/625-csi-migration#upgradedowngradeskew-testing) diff --git a/tests/e2e-upgrade/e2e_test.go b/tests/e2e-upgrade/e2e_test.go new file mode 100644 index 0000000000..dc2e8ce165 --- /dev/null +++ b/tests/e2e-upgrade/e2e_test.go @@ -0,0 +1,394 @@ +package e2e_upgrade + +import ( + "context" + "flag" + "fmt" + "math/rand" + "path/filepath" + "regexp" + "strings" + "testing" + "time" + + "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/util/homedir" + "k8s.io/kubernetes/test/e2e/framework" + frameworkconfig "k8s.io/kubernetes/test/e2e/framework/config" + e2epod "k8s.io/kubernetes/test/e2e/framework/pod" + e2epv "k8s.io/kubernetes/test/e2e/framework/pv" + "k8s.io/kubernetes/test/e2e/storage/utils" +) + +var ( + kopsBinaryPath = flag.String("binary", "kops", "") + kopsStateStore = flag.String("state", "s3://k8s-kops-csi-e2e", "") + kopsClusterName = flag.String("name", "", "") +) + +// TestKopsMigration tests the configurations described here: +// https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/csi-migration.md#upgradedowngradeskew-testing +func TestKopsMigration(t *testing.T) { + RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "TestKopsMigration") +} + +func init() { + rand.Seed(time.Now().UnixNano()) + + testing.Init() + frameworkconfig.CopyFlags(frameworkconfig.Flags, flag.CommandLine) + framework.RegisterCommonFlags(flag.CommandLine) + framework.RegisterClusterFlags(flag.CommandLine) + + flag.Parse() + + if home := homedir.HomeDir(); home != "" && framework.TestContext.KubeConfig == "" { + framework.TestContext.KubeConfig = filepath.Join(home, ".kube", "config") + } + framework.AfterReadingAllFlags(&framework.TestContext) + + ginkgo.Describe("Kops", func() { + var ( + k *kops + clientset *kubernetes.Clientset + f *framework.Framework + ) + k = &kops{*kopsBinaryPath, *kopsStateStore, *kopsClusterName} + var err error + clientset, err = k.exportKubecfg(framework.TestContext.KubeConfig) + if err != nil { + panic(err) + } + f = framework.NewFramework("kops-migrate", framework.Options{}, clientset) + + ginkgo.It("should call csi plugin for all operations after migration toggled on", func() { + migrationOn := false + toggleMigration(k, migrationOn) + _, inTreePVC, _ := createAndVerify(k, migrationOn, f, nil) + // Don't deleteAndVerify, the other test covers it. The inTreePod will + // get evicted & deleted as part of the following toggle + + migrationOn = true + toggleMigration(k, migrationOn) + csiPod, csiPVC, csiPV := createAndVerify(k, migrationOn, f, inTreePVC) + deleteAndVerify(f, migrationOn, csiPod, csiPVC, csiPV) + }) + + ginkgo.It("should call in-tree plugin for all operations after migration toggled off", func() { + migrationOn := true + toggleMigration(k, migrationOn) + _, csiPVC, _ := createAndVerify(k, migrationOn, f, nil) + // Don't deleteAndVerify, the other test covers it. The csiPod will + // get evicted & deleted as part of the following toggle + + migrationOn = false + toggleMigration(k, migrationOn) + inTreePod, inTreePVC, inTreePV := createAndVerify(k, migrationOn, f, csiPVC) + deleteAndVerify(f, migrationOn, inTreePod, inTreePVC, inTreePV) + }) + + /* + ginkgo.It("should call in-tree plugin for attach & mount and csi plugin for provision after kube-controller-manager migration toggled on and kubelet migration toggled off", func() { + // TODO + }) + */ + }) +} + +var ( + csiVerifier = verifier{ + name: "csi", + provisioner: "ebs.csi.aws.com", + plugin: "kubernetes.io/csi/ebs.csi.aws.com", + } + inTreeVerifier = verifier{ + name: "in-tree", + provisioner: "kubernetes.io/aws-ebs", + plugin: "kubernetes.io/aws-ebs", + } +) + +func toggleMigration(k *kops, migrationOn bool) { + var step string + var err error + if migrationOn { + step = "Toggling kube-controller-manager migration ON" + ginkgo.By(step) + err = k.toggleMigration("kubeControllerManager", migrationOn) + framework.ExpectNoError(err, step) + + step = "Toggling kubelet migration ON" + ginkgo.By(step) + err = k.toggleMigration("kubelet", migrationOn) + framework.ExpectNoError(err, step) + } else { + step = "Toggling kubelet migration OFF" + ginkgo.By(step) + err = k.toggleMigration("kubelet", migrationOn) + framework.ExpectNoError(err, step) + + step = "Toggling kube-controller-manager migration OFF" + ginkgo.By(step) + err = k.toggleMigration("kubeControllerManager", migrationOn) + framework.ExpectNoError(err, step) + } +} + +// createAndVerify creates a pod + pvc and verifies that csi/in-tree does +// operations according to whether migrationOn is true/false. optionally +// accepts a preTogglePVC to verify the same for a pvc that already existed +// prior to migration being toggled on/off +func createAndVerify(k *kops, migrationOn bool, f *framework.Framework, preTogglePVC *v1.PersistentVolumeClaim) (*v1.Pod, *v1.PersistentVolumeClaim, *v1.PersistentVolume) { + var step string + var err error + var v *verifier + if migrationOn { + v = &csiVerifier + } else { + v = &inTreeVerifier + } + + clientset, err := k.exportKubecfg(framework.TestContext.KubeConfig) + f.ClientSet = clientset + + if preTogglePVC != nil { + step = "Creating post-toggle Pod using pre-toggle PVC" + ginkgo.By(step) + extraPod, _, preTogglePV, err := createPodPVC(f, preTogglePVC) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Verifying pre-toggle PV %q got re-attached by %s", preTogglePV.Name, v.name) + ginkgo.By(step) + err = v.verifyAttach(f, preTogglePV) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Verifying pre-toggle PV %q got re-mounted by %s", preTogglePV.Name, v.name) + ginkgo.By(step) + err = v.verifyMount(f, preTogglePV, extraPod.Spec.NodeName) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Deleting pod %q", extraPod.Name) + ginkgo.By(step) + err = e2epod.DeletePodWithWait(f.ClientSet, extraPod) + framework.ExpectNoError(err, step) + } + + step = "Creating post-toggle Pod using post-toggle PVC" + ginkgo.By(step) + pod, pvc, pv, err := createPodPVC(f, nil) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Verifying post-toggle PV %q got attached by %s", pv.Name, v.name) + ginkgo.By(step) + err = v.verifyAttach(f, pv) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Verifying post-toggle PV %q got mounted by %s", pv.Name, v.name) + ginkgo.By(step) + err = v.verifyMount(f, pv, pod.Spec.NodeName) + framework.ExpectNoError(err, step) + + return pod, pvc, pv +} + +// deleteAndVerify deletes a pod + pvc and verifies that csi/in-tree does +// operations according to whether migrationOn is true/false +func deleteAndVerify(f *framework.Framework, migrationOn bool, pod *v1.Pod, pvc *v1.PersistentVolumeClaim, pv *v1.PersistentVolume) { + var step string + var err error + var v *verifier + if migrationOn { + v = &csiVerifier + } else { + v = &inTreeVerifier + } + + step = fmt.Sprintf("Deleting Pod %q", pod.Name) + ginkgo.By(step) + err = e2epod.DeletePodWithWait(f.ClientSet, pod) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Deleting PVC %q", pvc.Name) + ginkgo.By(step) + err = f.ClientSet.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Waiting for PV %q to be deleted", pv.Name) + ginkgo.By(step) + err = f.ClientSet.CoreV1().PersistentVolumeClaims(pvc.Namespace).Delete(context.TODO(), pvc.Name, metav1.DeleteOptions{}) + err = e2epv.WaitForPersistentVolumeDeleted(f.ClientSet, pvc.Spec.VolumeName, 30*time.Second, 2*time.Minute) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Verifying PV %q got unmounted by %s", pv.Name, v.name) + ginkgo.By(step) + err = v.verifyUnmount(f, pv, pod.Spec.NodeName) + framework.ExpectNoError(err, step) + + step = fmt.Sprintf("Verifying PV %q got detached by %s", pv.Name, v.name) + ginkgo.By(step) + err = v.verifyDetach(f, pv) + framework.ExpectNoError(err, step) +} + +func createPodPVC(f *framework.Framework, pvc *v1.PersistentVolumeClaim) (*v1.Pod, *v1.PersistentVolumeClaim, *v1.PersistentVolume, error) { + clientset := f.ClientSet + ns := f.Namespace.Name + var err error + + if pvc == nil { + pvc = &v1.PersistentVolumeClaim{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: f.BaseName, + }, + Spec: v1.PersistentVolumeClaimSpec{ + AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, + Resources: v1.ResourceRequirements{ + Requests: v1.ResourceList{ + v1.ResourceStorage: resource.MustParse("1Gi"), + }, + }, + }, + } + pvc, err = clientset.CoreV1().PersistentVolumeClaims(ns).Create(context.TODO(), pvc, metav1.CreateOptions{}) + if err != nil { + return nil, nil, nil, err + } + } + + pod := e2epod.MakePod(ns, nil, []*v1.PersistentVolumeClaim{pvc}, false, "") + pod, err = clientset.CoreV1().Pods(ns).Create(context.TODO(), pod, metav1.CreateOptions{}) + if err != nil { + return nil, nil, nil, err + } + + err = e2epod.WaitForPodNameRunningInNamespace(clientset, pod.Name, ns) + if err != nil { + return nil, nil, nil, err + } + + pod, err = clientset.CoreV1().Pods(ns).Get(context.TODO(), pod.Name, metav1.GetOptions{}) + if err != nil { + return nil, nil, nil, err + } + + pvc, err = clientset.CoreV1().PersistentVolumeClaims(ns).Get(context.TODO(), pvc.Name, metav1.GetOptions{}) + if err != nil { + return nil, nil, nil, err + } + + pv, err := clientset.CoreV1().PersistentVolumes().Get(context.TODO(), pvc.Spec.VolumeName, metav1.GetOptions{}) + if err != nil { + return nil, nil, nil, err + } + + return pod, pvc, pv, nil +} + +type verifier struct { + name string + provisioner string + plugin string +} + +/* +func (v *verifier) verifyProvision(pv *v1.PersistentVolume) error { + provisionedBy, ok := pv.Annotations["pv.kubernetes.io/provisioned-by"] + if !ok { + return errors.New("provisioned-by annotation missing") + } else if provisionedBy != v.provisioner { + return fmt.Errorf("provisioned-by annotation is %q but expected %q", provisionedBy, v.provisioner) + } + return nil +} + +// TODO verifyProvision/verifyDelete: check csi pod logs or kcm logs, relying on provisioned-by will break soon https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/pull/104 +*/ + +func (v *verifier) verifyAttach(f *framework.Framework, pv *v1.PersistentVolume) error { + re := regexp.MustCompile(fmt.Sprintf("AttachVolume.Attach.*%s.*%s", v.plugin, volumeID(pv))) + return findKubeControllerManagerLogs(f.ClientSet, re) +} + +func (v *verifier) verifyDetach(f *framework.Framework, pv *v1.PersistentVolume) error { + re := regexp.MustCompile(fmt.Sprintf("DetachVolume.Detach.*%s.*%s", v.plugin, volumeID(pv))) + return findKubeControllerManagerLogs(f.ClientSet, re) +} + +func (v *verifier) verifyMount(f *framework.Framework, pv *v1.PersistentVolume, nodeName string) error { + re := regexp.MustCompile(fmt.Sprintf("MountVolume.Mount.*%s.*%s", v.plugin, volumeID(pv))) + return findKubeletLogs(f, nodeName, re) +} + +func (v *verifier) verifyUnmount(f *framework.Framework, pv *v1.PersistentVolume, nodeName string) error { + re := regexp.MustCompile(fmt.Sprintf("UnmountVolume.TearDown.*%s.*%s", v.plugin, volumeID(pv))) + return findKubeletLogs(f, nodeName, re) +} + +func volumeID(pv *v1.PersistentVolume) string { + segments := strings.Split(pv.Spec.AWSElasticBlockStore.VolumeID, "/") + return segments[len(segments)-1] +} + +func findKubeletLogs(f *framework.Framework, nodeName string, re *regexp.Regexp) error { + logs, err := kubeletLogs(f, nodeName) + if err != nil { + return fmt.Errorf("error getting kubelet logs: %v", err) + } + match := re.FindString(logs) + if match == "" { + return fmt.Errorf("regexp %q not found", re) + } + return nil +} + +func findKubeControllerManagerLogs(clientset kubernetes.Interface, re *regexp.Regexp) error { + logs, err := kubeControllerManagerLogs(clientset) + if err != nil { + return fmt.Errorf("error getting kube-controller-manager logs: %v", err) + } + match := re.FindString(logs) + if match == "" { + return fmt.Errorf("regexp %q not found", re) + } + return nil +} + +func kubeletLogs(f *framework.Framework, nodeName string) (string, error) { + hostExec := utils.NewHostExec(f) + node, err := f.ClientSet.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{}) + if err != nil { + return "", err + } + logs, err := hostExec.IssueCommandWithResult("journalctl -u kubelet", node) + if err != nil { + return "", err + } + return logs, nil +} + +func kubeControllerManagerLogs(clientset kubernetes.Interface) (string, error) { + return podLogs(clientset, "kube-controller-manager") +} + +func podLogs(clientset kubernetes.Interface, podNamePrefix string) (string, error) { + pods, err := clientset.CoreV1().Pods(metav1.NamespaceSystem).List(context.TODO(), metav1.ListOptions{}) + if err != nil { + return "", err + } + for _, pod := range pods.Items { + if strings.HasPrefix(pod.Name, podNamePrefix) { + body, err := clientset.CoreV1().Pods(metav1.NamespaceSystem).GetLogs(pod.Name, &v1.PodLogOptions{}).Do(context.TODO()).Raw() + if err != nil { + return "", err + } + return string(body), nil + } + } + return "", fmt.Errorf("%q pod not found", podNamePrefix) +} diff --git a/tests/e2e-upgrade/kops.go b/tests/e2e-upgrade/kops.go new file mode 100644 index 0000000000..f527eeb6cc --- /dev/null +++ b/tests/e2e-upgrade/kops.go @@ -0,0 +1,170 @@ +package e2e_upgrade + +import ( + "fmt" + "io/ioutil" + "log" + "os" + "os/exec" + "strconv" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/clientcmd" +) + +type kops struct { + kopsBinaryPath string + kopsStateStore string + kopsClusterName string +} + +func (k *kops) commandQuiet(args ...string) *exec.Cmd { + args = append(args, "--state", k.kopsStateStore, "--name", k.kopsClusterName) + cmd := exec.Command(k.kopsBinaryPath, args...) + log.Print(cmd.String()) + return cmd +} + +func (k *kops) command(args ...string) *exec.Cmd { + cmd := k.commandQuiet(args...) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + return cmd +} + +func (k *kops) getCluster() (*unstructured.Unstructured, error) { + cmd := k.commandQuiet( + "get", + "cluster", + "-o", + "json", + ) + out, err := cmd.CombinedOutput() + if err != nil { + return nil, fmt.Errorf("out: %v, err: %v", string(out), err) + } + + // kops client/API takes a long time to compile so settle for kops cli and unstructured + cluster := new(unstructured.Unstructured) + _, _, err = unstructured.UnstructuredJSONScheme.Decode(out, nil, cluster) + if err != nil { + return nil, err + } + + return cluster, nil +} + +// similar to kubetest2 code +// https://github.com/kubernetes/kops/tree/master/tests/e2e/kubetest2-kops/deployer +func (k *kops) updateCluster(cluster *unstructured.Unstructured) error { + tmpfile, err := ioutil.TempFile("", "cluster") + if err != nil { + log.Fatal(err) + } + err = unstructured.UnstructuredJSONScheme.Encode(cluster, tmpfile) + if err != nil { + log.Fatal(err) + } + + cmd := k.command( + "replace", + "-f", + tmpfile.Name(), + ) + err = cmd.Run() + if err != nil { + return err + } + + cmd = k.command( + "update", + "cluster", + "--yes", + ) + err = cmd.Run() + if err != nil { + return err + } + + cmd = k.command( + "rolling-update", + "cluster", + "--yes", + ) + err = cmd.Run() + if err != nil { + return err + } + + return nil +} + +func (k *kops) exportKubecfg(kubeconfig string) (*kubernetes.Clientset, error) { + cmd := k.command( + "export", + "kubecfg", + "--admin", + "--kubeconfig", + kubeconfig, + ) + err := cmd.Run() + if err != nil { + return nil, err + } + + config, err := clientcmd.BuildConfigFromFlags("", kubeconfig) + if err != nil { + return nil, err + } + + clientset, err := kubernetes.NewForConfig(config) + if err != nil { + return nil, err + } + + return clientset, nil +} + +func (k *kops) setFeatureGate(cluster *unstructured.Unstructured, component, featureGate string, on bool) (*unstructured.Unstructured, error) { + featureGates, found, err := unstructured.NestedMap(cluster.Object, "spec", component, "featureGates") + if err != nil { + return nil, err + } + if !found { + featureGates = make(map[string]interface{}) + } + + featureGates[featureGate] = strconv.FormatBool(on) + + err = unstructured.SetNestedMap(cluster.Object, featureGates, "spec", component, "featureGates") + if err != nil { + return nil, err + } + + return cluster, nil +} + +func (k *kops) toggleMigration(component string, on bool) error { + cluster, err := k.getCluster() + if err != nil { + return err + } + + cluster, err = k.setFeatureGate(cluster, component, "CSIMigration", on) + if err != nil { + return err + } + + cluster, err = k.setFeatureGate(cluster, component, "CSIMigrationAWS", on) + if err != nil { + return err + } + + err = k.updateCluster(cluster) + if err != nil { + return err + } + + return nil +} From fbd9b4ee097e89fc61f46cbdc338b6670cf85e4f Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 6 Apr 2021 17:35:19 -0700 Subject: [PATCH 29/59] Implement Windows NodePublish/Unpublish --- Dockerfile | 2 +- Dockerfile.windows | 23 +++++ Makefile | 4 + pkg/driver/mount.go | 187 +++--------------------------------- pkg/driver/mount_linux.go | 184 +++++++++++++++++++++++++++++++++++ pkg/driver/mount_test.go | 6 +- pkg/driver/mount_windows.go | 99 +++++++++++++++++++ pkg/driver/node.go | 11 +-- pkg/driver/node_linux.go | 12 ++- pkg/driver/node_windows.go | 98 +++++++++++++++++++ 10 files changed, 441 insertions(+), 185 deletions(-) create mode 100644 Dockerfile.windows create mode 100644 pkg/driver/mount_linux.go create mode 100644 pkg/driver/mount_windows.go create mode 100644 pkg/driver/node_windows.go diff --git a/Dockerfile b/Dockerfile index aa6464e644..2c79af3489 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.15.6 AS builder +FROM golang:1.16 AS builder WORKDIR /go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver COPY . . RUN make diff --git a/Dockerfile.windows b/Dockerfile.windows new file mode 100644 index 0000000000..420096dd38 --- /dev/null +++ b/Dockerfile.windows @@ -0,0 +1,23 @@ +# Copyright 2019 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. + +FROM --platform=$BUILDPLATFORM golang:1.16 AS builder +WORKDIR /go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver +COPY . . +RUN make bin/aws-ebs-csi-driver.exe + +FROM mcr.microsoft.com/windows/servercore:1809 +COPY --from=builder /go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/bin/aws-ebs-csi-driver.exe /aws-ebs-csi-driver.exe + +ENTRYPOINT ["/aws-ebs-csi-driver.exe"] diff --git a/Makefile b/Makefile index 91781e98c7..743eabc945 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,10 @@ GOBIN=$(shell pwd)/bin bin/aws-ebs-csi-driver: | bin CGO_ENABLED=0 GOOS=linux go build -mod=vendor -ldflags ${LDFLAGS} -o bin/aws-ebs-csi-driver ./cmd/ +.PHONY: bin/aws-ebs-csi-driver.exe +bin/aws-ebs-csi-driver.exe: | bin + CGO_ENABLED=0 GOOS=windows go build -mod=vendor -ldflags ${LDFLAGS} -o bin/aws-ebs-csi-driver.exe ./cmd/ + bin /tmp/helm /tmp/kubeval: @mkdir -p $@ diff --git a/pkg/driver/mount.go b/pkg/driver/mount.go index f1ce7b48c8..0e3e938a0b 100644 --- a/pkg/driver/mount.go +++ b/pkg/driver/mount.go @@ -17,199 +17,40 @@ limitations under the License. package driver import ( - "fmt" - "k8s.io/klog" - "os" - "strconv" - "strings" - "github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/mounter" mountutils "k8s.io/mount-utils" - utilexec "k8s.io/utils/exec" ) +type mountInterface = mountutils.Interface + +// Mounter is the interface implemented by NodeMounter. +// A mix & match of functions defined in upstream libraries. (FormatAndMount +// from struct SafeFormatAndMount, PathExists from an old edition of +// mount.Interface). Define it explicitly so that it can be mocked and to +// insulate from oft-changing upstream interfaces/structs type Mounter interface { - // Implemented by NodeMounter.SafeFormatAndMount - mountutils.Interface - FormatAndMount(source string, target string, fstype string, options []string) error + mountInterface - // Implemented by NodeMounter.SafeFormatAndMount.Exec - // TODO this won't make sense on Windows with csi-proxy - utilexec.Interface + FormatAndMount(source string, target string, fstype string, options []string) error - // Implemented by NodeMounter below GetDeviceNameFromMount(mountPath string) (string, int, error) - // TODO this won't make sense on Windows with csi-proxy MakeFile(path string) error MakeDir(path string) error PathExists(path string) (bool, error) NeedResize(devicePath string, deviceMountPath string) (bool, error) } +// NodeMounter implements Mounter. +// A superstruct of SafeFormatAndMount. type NodeMounter struct { - mountutils.SafeFormatAndMount - utilexec.Interface + *mountutils.SafeFormatAndMount } func newNodeMounter() (Mounter, error) { + // mounter.NewSafeMounter returns a SafeFormatAndMount safeMounter, err := mounter.NewSafeMounter() if err != nil { return nil, err } - return &NodeMounter{*safeMounter, safeMounter.Exec}, nil -} - -// GetDeviceNameFromMount returns the volume ID for a mount path. -func (m NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error) { - return mountutils.GetDeviceNameFromMount(m, mountPath) -} - -// This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code -// Please mirror the change to func MakeFile in ./sanity_test.go -func (m *NodeMounter) MakeFile(path string) error { - f, err := os.OpenFile(path, os.O_CREATE, os.FileMode(0644)) - if err != nil { - if !os.IsExist(err) { - return err - } - } - if err = f.Close(); err != nil { - return err - } - return nil -} - -// This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code -// Please mirror the change to func MakeFile in ./sanity_test.go -func (m *NodeMounter) MakeDir(path string) error { - err := os.MkdirAll(path, os.FileMode(0755)) - if err != nil { - if !os.IsExist(err) { - return err - } - } - return nil -} - -// This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code -// Please mirror the change to func MakeFile in ./sanity_test.go -func (m *NodeMounter) PathExists(path string) (bool, error) { - return mountutils.PathExists(path) -} - -//TODO: use common util from vendor kubernetes/mount-util -func (m *NodeMounter) NeedResize(devicePath string, deviceMountPath string) (bool, error) { - // TODO(xiangLi) resize fs size on formatted file system following this PR https://github.com/kubernetes/kubernetes/pull/99223 - // Port the in-tree un-released change first, need to remove after in-tree release - deviceSize, err := m.getDeviceSize(devicePath) - if err != nil { - return false, err - } - var fsSize, blockSize uint64 - format, err := m.SafeFormatAndMount.GetDiskFormat(devicePath) - if err != nil { - formatErr := fmt.Errorf("ResizeFS.Resize - error checking format for device %s: %v", devicePath, err) - return false, formatErr - } - - // If disk has no format, there is no need to resize the disk because mkfs.* - // by default will use whole disk anyways. - if format == "" { - return false, nil - } - - klog.V(3).Infof("ResizeFs.needResize - checking mounted volume %s", devicePath) - switch format { - case "ext3", "ext4": - blockSize, fsSize, err = m.getExtSize(devicePath) - klog.V(5).Infof("Ext size: filesystem size=%d, block size=%d", fsSize, blockSize) - case "xfs": - blockSize, fsSize, err = m.getXFSSize(deviceMountPath) - klog.V(5).Infof("Xfs size: filesystem size=%d, block size=%d, err=%v", fsSize, blockSize, err) - default: - klog.Errorf("Not able to parse given filesystem info. fsType: %s, will not resize", format) - return false, fmt.Errorf("Could not parse fs info on given filesystem format: %s. Supported fs types are: xfs, ext3, ext4", format) - } - if err != nil { - return false, err - } - // Tolerate one block difference, just in case of rounding errors somewhere. - klog.V(5).Infof("Volume %s: device size=%d, filesystem size=%d, block size=%d", devicePath, deviceSize, fsSize, blockSize) - if deviceSize <= fsSize+blockSize { - return false, nil - } - return true, nil -} -func (m *NodeMounter) getDeviceSize(devicePath string) (uint64, error) { - output, err := m.SafeFormatAndMount.Exec.Command("blockdev", "--getsize64", devicePath).CombinedOutput() - outStr := strings.TrimSpace(string(output)) - if err != nil { - return 0, fmt.Errorf("failed to read size of device %s: %s: %s", devicePath, err, outStr) - } - size, err := strconv.ParseUint(outStr, 10, 64) - if err != nil { - return 0, fmt.Errorf("failed to parse size of device %s %s: %s", devicePath, outStr, err) - } - return size, nil -} - -func (m *NodeMounter) getExtSize(devicePath string) (uint64, uint64, error) { - output, err := m.SafeFormatAndMount.Exec.Command("dumpe2fs", "-h", devicePath).CombinedOutput() - if err != nil { - return 0, 0, fmt.Errorf("failed to read size of filesystem on %s: %s: %s", devicePath, err, string(output)) - } - - blockSize, blockCount, _ := m.parseFsInfoOutput(string(output), ":", "block size", "block count") - - if blockSize == 0 { - return 0, 0, fmt.Errorf("could not find block size of device %s", devicePath) - } - if blockCount == 0 { - return 0, 0, fmt.Errorf("could not find block count of device %s", devicePath) - } - return blockSize, blockSize * blockCount, nil -} - -func (m *NodeMounter) getXFSSize(devicePath string) (uint64, uint64, error) { - output, err := m.SafeFormatAndMount.Exec.Command("xfs_io", "-c", "statfs", devicePath).CombinedOutput() - if err != nil { - return 0, 0, fmt.Errorf("failed to read size of filesystem on %s: %s: %s", devicePath, err, string(output)) - } - - blockSize, blockCount, _ := m.parseFsInfoOutput(string(output), "=", "geom.bsize", "geom.datablocks") - - if blockSize == 0 { - return 0, 0, fmt.Errorf("could not find block size of device %s", devicePath) - } - if blockCount == 0 { - return 0, 0, fmt.Errorf("could not find block count of device %s", devicePath) - } - return blockSize, blockSize * blockCount, nil -} - -func (m *NodeMounter) parseFsInfoOutput(cmdOutput string, spliter string, blockSizeKey string, blockCountKey string) (uint64, uint64, error) { - lines := strings.Split(cmdOutput, "\n") - var blockSize, blockCount uint64 - var err error - - for _, line := range lines { - tokens := strings.Split(line, spliter) - if len(tokens) != 2 { - continue - } - key, value := strings.ToLower(strings.TrimSpace(tokens[0])), strings.ToLower(strings.TrimSpace(tokens[1])) - if key == blockSizeKey { - blockSize, err = strconv.ParseUint(value, 10, 64) - if err != nil { - return 0, 0, fmt.Errorf("failed to parse block size %s: %s", value, err) - } - } - if key == blockCountKey { - blockCount, err = strconv.ParseUint(value, 10, 64) - if err != nil { - return 0, 0, fmt.Errorf("failed to parse block count %s: %s", value, err) - } - } - } - return blockSize, blockCount, err + return &NodeMounter{safeMounter}, nil } diff --git a/pkg/driver/mount_linux.go b/pkg/driver/mount_linux.go new file mode 100644 index 0000000000..ea4427c549 --- /dev/null +++ b/pkg/driver/mount_linux.go @@ -0,0 +1,184 @@ +// +build linux + +/* +Copyright 2019 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 driver + +import ( + "fmt" + "k8s.io/klog" + "os" + "strconv" + "strings" + + mountutils "k8s.io/mount-utils" +) + +// GetDeviceNameFromMount returns the volume ID for a mount path. +func (m NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error) { + return mountutils.GetDeviceNameFromMount(m, mountPath) +} + +// This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code +// Please mirror the change to func MakeFile in ./sanity_test.go +func (m *NodeMounter) MakeFile(path string) error { + f, err := os.OpenFile(path, os.O_CREATE, os.FileMode(0644)) + if err != nil { + if !os.IsExist(err) { + return err + } + } + if err = f.Close(); err != nil { + return err + } + return nil +} + +// This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code +// Please mirror the change to func MakeFile in ./sanity_test.go +func (m *NodeMounter) MakeDir(path string) error { + err := os.MkdirAll(path, os.FileMode(0755)) + if err != nil { + if !os.IsExist(err) { + return err + } + } + return nil +} + +// This function is mirrored in ./sanity_test.go to make sure sanity test covered this block of code +// Please mirror the change to func MakeFile in ./sanity_test.go +func (m *NodeMounter) PathExists(path string) (bool, error) { + return mountutils.PathExists(path) +} + +//TODO: use common util from vendor kubernetes/mount-util +func (m *NodeMounter) NeedResize(devicePath string, deviceMountPath string) (bool, error) { + // TODO(xiangLi) resize fs size on formatted file system following this PR https://github.com/kubernetes/kubernetes/pull/99223 + // Port the in-tree un-released change first, need to remove after in-tree release + deviceSize, err := m.getDeviceSize(devicePath) + if err != nil { + return false, err + } + var fsSize, blockSize uint64 + format, err := m.SafeFormatAndMount.GetDiskFormat(devicePath) + if err != nil { + formatErr := fmt.Errorf("ResizeFS.Resize - error checking format for device %s: %v", devicePath, err) + return false, formatErr + } + + // If disk has no format, there is no need to resize the disk because mkfs.* + // by default will use whole disk anyways. + if format == "" { + return false, nil + } + + klog.V(3).Infof("ResizeFs.needResize - checking mounted volume %s", devicePath) + switch format { + case "ext3", "ext4": + blockSize, fsSize, err = m.getExtSize(devicePath) + klog.V(5).Infof("Ext size: filesystem size=%d, block size=%d", fsSize, blockSize) + case "xfs": + blockSize, fsSize, err = m.getXFSSize(deviceMountPath) + klog.V(5).Infof("Xfs size: filesystem size=%d, block size=%d, err=%v", fsSize, blockSize, err) + default: + klog.Errorf("Not able to parse given filesystem info. fsType: %s, will not resize", format) + return false, fmt.Errorf("Could not parse fs info on given filesystem format: %s. Supported fs types are: xfs, ext3, ext4", format) + } + if err != nil { + return false, err + } + // Tolerate one block difference, just in case of rounding errors somewhere. + klog.V(5).Infof("Volume %s: device size=%d, filesystem size=%d, block size=%d", devicePath, deviceSize, fsSize, blockSize) + if deviceSize <= fsSize+blockSize { + return false, nil + } + return true, nil +} +func (m *NodeMounter) getDeviceSize(devicePath string) (uint64, error) { + output, err := m.SafeFormatAndMount.Exec.Command("blockdev", "--getsize64", devicePath).CombinedOutput() + outStr := strings.TrimSpace(string(output)) + if err != nil { + return 0, fmt.Errorf("failed to read size of device %s: %s: %s", devicePath, err, outStr) + } + size, err := strconv.ParseUint(outStr, 10, 64) + if err != nil { + return 0, fmt.Errorf("failed to parse size of device %s %s: %s", devicePath, outStr, err) + } + return size, nil +} + +func (m *NodeMounter) getExtSize(devicePath string) (uint64, uint64, error) { + output, err := m.SafeFormatAndMount.Exec.Command("dumpe2fs", "-h", devicePath).CombinedOutput() + if err != nil { + return 0, 0, fmt.Errorf("failed to read size of filesystem on %s: %s: %s", devicePath, err, string(output)) + } + + blockSize, blockCount, _ := m.parseFsInfoOutput(string(output), ":", "block size", "block count") + + if blockSize == 0 { + return 0, 0, fmt.Errorf("could not find block size of device %s", devicePath) + } + if blockCount == 0 { + return 0, 0, fmt.Errorf("could not find block count of device %s", devicePath) + } + return blockSize, blockSize * blockCount, nil +} + +func (m *NodeMounter) getXFSSize(devicePath string) (uint64, uint64, error) { + output, err := m.SafeFormatAndMount.Exec.Command("xfs_io", "-c", "statfs", devicePath).CombinedOutput() + if err != nil { + return 0, 0, fmt.Errorf("failed to read size of filesystem on %s: %s: %s", devicePath, err, string(output)) + } + + blockSize, blockCount, _ := m.parseFsInfoOutput(string(output), "=", "geom.bsize", "geom.datablocks") + + if blockSize == 0 { + return 0, 0, fmt.Errorf("could not find block size of device %s", devicePath) + } + if blockCount == 0 { + return 0, 0, fmt.Errorf("could not find block count of device %s", devicePath) + } + return blockSize, blockSize * blockCount, nil +} + +func (m *NodeMounter) parseFsInfoOutput(cmdOutput string, spliter string, blockSizeKey string, blockCountKey string) (uint64, uint64, error) { + lines := strings.Split(cmdOutput, "\n") + var blockSize, blockCount uint64 + var err error + + for _, line := range lines { + tokens := strings.Split(line, spliter) + if len(tokens) != 2 { + continue + } + key, value := strings.ToLower(strings.TrimSpace(tokens[0])), strings.ToLower(strings.TrimSpace(tokens[1])) + if key == blockSizeKey { + blockSize, err = strconv.ParseUint(value, 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("failed to parse block size %s: %s", value, err) + } + } + if key == blockCountKey { + blockCount, err = strconv.ParseUint(value, 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("failed to parse block count %s: %s", value, err) + } + } + } + return blockSize, blockCount, err +} diff --git a/pkg/driver/mount_test.go b/pkg/driver/mount_test.go index 18354e9442..32eb5a95f0 100644 --- a/pkg/driver/mount_test.go +++ b/pkg/driver/mount_test.go @@ -234,7 +234,7 @@ Journal checksum: 0xb7df3c6e Interface: mount.New(""), Exec: &fexec, } - fakeMounter := NodeMounter{safe, &fexec} + fakeMounter := NodeMounter{&safe} var blockSize uint64 var fsSize uint64 @@ -296,9 +296,9 @@ func TestNeedResize(t *testing.T) { } safe := mount.SafeFormatAndMount{ Interface: mount.New(""), - Exec: utilexec.New(), + Exec: &fexec, } - fakeMounter := NodeMounter{safe, &fexec} + fakeMounter := NodeMounter{&safe} needResize, err := fakeMounter.NeedResize(test.devicePath, test.deviceMountPath) if needResize != test.expectResult { diff --git a/pkg/driver/mount_windows.go b/pkg/driver/mount_windows.go new file mode 100644 index 0000000000..916672a136 --- /dev/null +++ b/pkg/driver/mount_windows.go @@ -0,0 +1,99 @@ +// +build windows + +/* +Copyright 2019 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 driver + +import ( + "fmt" + "regexp" + + "github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/mounter" +) + +func (m NodeMounter) FormatAndMount(source string, target string, fstype string, options []string) error { + proxyMounter, ok := m.SafeFormatAndMount.Interface.(*mounter.CSIProxyMounter) + if !ok { + return fmt.Errorf("failed to cast mounter to csi proxy mounter") + } + return proxyMounter.FormatAndMount(source, target, fstype, options) +} + +// GetDeviceNameFromMount returns the volume ID for a mount path. +// The ref count returned is always 1 or 0 because csi-proxy doesn't provide a +// way to determine the actual ref count (as opposed to Linux where the mount +// table gets read). In practice this shouldn't matter, as in the NodeStage +// case the ref count is ignored and in the NodeUnstage case, the ref count +// being >1 is just a warning. +// Command to determine ref count would be something like: +// Get-Volume -UniqueId "\\?\Volume{7c3da0c1-0000-0000-0000-010000000000}\" | Get-Partition | Select AccessPaths +func (m NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error) { + proxyMounter, ok := m.SafeFormatAndMount.Interface.(*mounter.CSIProxyMounter) + if !ok { + return "", 0, fmt.Errorf("failed to cast mounter to csi proxy mounter") + } + deviceName, err := proxyMounter.GetDeviceNameFromMount(mountPath, "") + if err != nil { + // HACK change csi-proxy behavior instead of relying on fragile internal + // implementation details! + // if err contains '"(Get-Item...).Target, output: , error: ' then the + // internal Get-Item cmdlet didn't fail but no item/device was found at the + // path so we should return empty string and nil error just like the Linux + // implementation would. + pattern := `(Get-Item -Path \S+).Target, output: , error: ` + matched, matchErr := regexp.MatchString(pattern, err.Error()) + if matched { + return "", 0, nil + } + err = fmt.Errorf("error getting device name from mount: %v", err) + if matchErr != nil { + err = fmt.Errorf("%v, and error matching pattern %q: %v", err, pattern, matchErr) + } + return "", 0, err + } + return deviceName, 1, nil +} + +func (m *NodeMounter) MakeFile(path string) error { + proxyMounter, ok := m.SafeFormatAndMount.Interface.(*mounter.CSIProxyMounter) + if !ok { + return fmt.Errorf("failed to cast mounter to csi proxy mounter") + } + return proxyMounter.MakeFile(path) +} + +func (m *NodeMounter) MakeDir(path string) error { + proxyMounter, ok := m.SafeFormatAndMount.Interface.(*mounter.CSIProxyMounter) + if !ok { + return fmt.Errorf("failed to cast mounter to csi proxy mounter") + } + return proxyMounter.MakeDir(path) +} + +func (m *NodeMounter) PathExists(path string) (bool, error) { + proxyMounter, ok := m.SafeFormatAndMount.Interface.(*mounter.CSIProxyMounter) + if !ok { + return false, fmt.Errorf("failed to cast mounter to csi proxy mounter") + } + return proxyMounter.ExistsPath(path) +} + +func (m *NodeMounter) NeedResize(devicePath string, deviceMountPath string) (bool, error) { + // TODO this is called at NodeStage to ensure file system is the correct size + // Implement it to respect spec v1.4.0 https://github.com/container-storage-interface/spec/pull/452 + return false, nil +} diff --git a/pkg/driver/node.go b/pkg/driver/node.go index c844cc4416..641e16a732 100644 --- a/pkg/driver/node.go +++ b/pkg/driver/node.go @@ -218,7 +218,7 @@ func (d *nodeService) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol return nil, status.Errorf(codes.Internal, "Could not determine if volume %q (%q) need to be resized: %v", req.GetVolumeId(), source, err) } if needResize { - r := mountutils.NewResizeFs(d.mounter) + r := mountutils.NewResizeFs(d.mounter.(*NodeMounter).Exec) klog.V(2).Infof("Volume %s needs resizing", source) if _, err := r.Resize(source, target); err != nil { return nil, status.Errorf(codes.Internal, "Could not resize volume %q (%q): %v", volumeID, source, err) @@ -321,7 +321,7 @@ func (d *nodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV // TODO this won't make sense on Windows with csi-proxy args := []string{"-o", "source", "--noheadings", "--target", volumePath} - output, err := d.mounter.Command("findmnt", args...).Output() + output, err := d.mounter.(*NodeMounter).Exec.Command("findmnt", args...).Output() if err != nil { return nil, status.Errorf(codes.Internal, "Could not determine device path: %v", err) @@ -331,7 +331,7 @@ func (d *nodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV return nil, status.Errorf(codes.Internal, "Could not get valid device for mount path: %q", req.GetVolumePath()) } - r := mountutils.NewResizeFs(d.mounter) + r := mountutils.NewResizeFs(d.mounter.(*NodeMounter).Exec) // TODO: lock per volume ID to have some idempotency if _, err := r.Resize(devicePath, volumePath); err != nil { @@ -608,9 +608,8 @@ func (d *nodeService) nodePublishVolumeForFileSystem(req *csi.NodePublishVolumeR } } - klog.V(4).Infof("NodePublishVolume: creating dir %s", target) - if err := d.mounter.MakeDir(target); err != nil { - return status.Errorf(codes.Internal, "Could not create dir %q: %v", target, err) + if err := d.preparePublishTarget(target); err != nil { + return status.Errorf(codes.Internal, err.Error()) } fsType := mode.Mount.GetFsType() diff --git a/pkg/driver/node_linux.go b/pkg/driver/node_linux.go index 4c4a9d0955..a6efa9b305 100644 --- a/pkg/driver/node_linux.go +++ b/pkg/driver/node_linux.go @@ -26,7 +26,7 @@ import ( "strings" "golang.org/x/sys/unix" - "k8s.io/klog" + "k8s.io/klog/v2" ) // findDevicePath finds path of device and verifies its existence @@ -93,6 +93,14 @@ func findNvmeVolume(findName string) (device string, err error) { return resolved, nil } +func (d *nodeService) preparePublishTarget(target string) error { + klog.V(4).Infof("NodePublishVolume: creating dir %s", target) + if err := d.mounter.MakeDir(target); err != nil { + return fmt.Errorf("Could not create dir %q: %v", target, err) + } + return nil +} + // IsBlock checks if the given path is a block device func (d *nodeService) IsBlockDevice(fullPath string) (bool, error) { var st unix.Stat_t @@ -105,7 +113,7 @@ func (d *nodeService) IsBlockDevice(fullPath string) (bool, error) { } func (d *nodeService) getBlockSizeBytes(devicePath string) (int64, error) { - cmd := d.mounter.Command("blockdev", "--getsize64", devicePath) + cmd := d.mounter.(*NodeMounter).Exec.Command("blockdev", "--getsize64", devicePath) output, err := cmd.Output() if err != nil { return -1, fmt.Errorf("error when getting size of block volume at path %s: output: %s, err: %v", devicePath, string(output), err) diff --git a/pkg/driver/node_windows.go b/pkg/driver/node_windows.go new file mode 100644 index 0000000000..715a403a72 --- /dev/null +++ b/pkg/driver/node_windows.go @@ -0,0 +1,98 @@ +// +build windows + +/* +Copyright 2019 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 driver + +import ( + "context" + "errors" + "fmt" + "strings" + + diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2" + diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2" + "github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/mounter" + "k8s.io/klog" +) + +// findDevicePath finds disk number of device +// https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-windows-volumes.html#list-nvme-powershell +func (d *nodeService) findDevicePath(devicePath, volumeID, _ string) (string, error) { + + diskClient, err := diskclient.NewClient() + if err != nil { + return "", fmt.Errorf("error creating csi-proxy disk client: %q", err) + } + defer diskClient.Close() + + response, err := diskClient.ListDiskIDs(context.TODO(), &diskapi.ListDiskIDsRequest{}) + if err != nil { + return "", fmt.Errorf("error listing disk ids: %q", err) + } + + diskIDs := response.GetDiskIDs() + + foundDiskNumber := "" + for diskNumber, diskID := range diskIDs { + serialNumber := diskID.Identifiers["serialNumber"] + cleanVolumeID := strings.ReplaceAll(volumeID, "-", "") + if strings.Contains(serialNumber, cleanVolumeID) { + foundDiskNumber = diskNumber + break + } + } + + if foundDiskNumber == "" { + return "", fmt.Errorf("disk number for device path %q volume id %q not found", devicePath, volumeID) + } + + return foundDiskNumber, nil +} + +func (d *nodeService) preparePublishTarget(target string) error { + // On Windows, Mount will create the parent of target and mklink (create a symbolic link) at target later, so don't create a + // directory at target now. Otherwise mklink will error: "Cannot create a file when that file already exists". + // Instead, delete the target if it already exists (like if it was created by kubelet <1.20) + // https://github.com/kubernetes/kubernetes/pull/88759 + klog.V(4).Infof("NodePublishVolume: removing dir %s", target) + exists, err := d.mounter.PathExists(target) + if err != nil { + return fmt.Errorf("error checking path %q exists: %v", target, err) + } + + proxyMounter, ok := (d.mounter.(*NodeMounter)).SafeFormatAndMount.Interface.(*mounter.CSIProxyMounter) + if !ok { + return fmt.Errorf("failed to cast mounter to csi proxy mounter") + } + + if exists { + if err := proxyMounter.Rmdir(target); err != nil { + return fmt.Errorf("error Rmdir target %q: %v", target, err) + } + } + return nil +} + +// IsBlock checks if the given path is a block device +func (d *nodeService) IsBlockDevice(fullPath string) (bool, error) { + return false, errors.New("unsupported") +} + +func (d *nodeService) getBlockSizeBytes(devicePath string) (int64, error) { + return 0, errors.New("unsupported") +} From a9967618a94a89d1cfad60cfc21f1a95b4733eae Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 6 Apr 2021 17:35:45 -0700 Subject: [PATCH 30/59] Add Windows node example for developers --- .../templates/node-windows.yaml | 169 ++++++++++++++++++ examples/kubernetes/windows/README.md | 74 ++++++++ .../kubernetes/windows/specs/windows.yaml | 59 ++++++ 3 files changed, 302 insertions(+) create mode 100644 charts/aws-ebs-csi-driver/templates/node-windows.yaml create mode 100644 examples/kubernetes/windows/README.md create mode 100644 examples/kubernetes/windows/specs/windows.yaml diff --git a/charts/aws-ebs-csi-driver/templates/node-windows.yaml b/charts/aws-ebs-csi-driver/templates/node-windows.yaml new file mode 100644 index 0000000000..9408db42d0 --- /dev/null +++ b/charts/aws-ebs-csi-driver/templates/node-windows.yaml @@ -0,0 +1,169 @@ +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: ebs-csi-node-windows + namespace: kube-system + labels: + {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + app: ebs-csi-node + {{- include "aws-ebs-csi-driver.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + app: ebs-csi-node + {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }} + {{- if .Values.node.podAnnotations }} + annotations: {{ toYaml .Values.node.podAnnotations | nindent 8 }} + {{- end }} + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: eks.amazonaws.com/compute-type + operator: NotIn + values: + - fargate + nodeSelector: + kubernetes.io/os: windows + {{- with .Values.node.nodeSelector }} +{{ toYaml . | indent 8 }} + {{- end }} + # hostNetwork: true + serviceAccountName: {{ .Values.serviceAccount.node.name }} + priorityClassName: {{ .Values.node.priorityClassName | default "system-cluster-critical" }} + tolerations: + {{- if .Values.node.tolerateAllTaints }} + - operator: Exists + {{- end }} + {{- with .Values.node.tolerations }} +{{ toYaml . | indent 8 }} + {{- end }} + containers: + - name: ebs-plugin + image: public.ecr.aws/b5w6x5z2/aws-ebs-csi-driver:windows + imagePullPolicy: Always + args: + - node + - --endpoint=$(CSI_ENDPOINT) + {{- if .Values.volumeAttachLimit }} + - --volume-attach-limit={{ .Values.volumeAttachLimit }} + {{- end }} + - --logtostderr + - --v=5 + env: + - name: CSI_ENDPOINT + value: unix:/csi/csi.sock + volumeMounts: + - name: kubelet-dir + mountPath: C:\var\lib\kubelet + mountPropagation: "None" + - name: plugin-dir + mountPath: C:\csi + - name: csi-proxy-disk-pipe + mountPath: \\.\pipe\csi-proxy-disk-v1beta2 + - name: csi-proxy-volume-pipe + mountPath: \\.\pipe\csi-proxy-volume-v1beta2 + - name: csi-proxy-filesystem-pipe + mountPath: \\.\pipe\csi-proxy-filesystem-v1beta1 + ports: + - name: healthz + containerPort: 9808 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: healthz + initialDelaySeconds: 10 + timeoutSeconds: 3 + periodSeconds: 10 + failureThreshold: 5 + {{- if .Values.node.resources }} + {{- with .Values.node.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- else }} + {{- with .Values.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- end }} + - name: node-driver-registrar + image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrarImage.repository .Values.sidecars.nodeDriverRegistrarImage.tag }} + args: + - --csi-address=$(ADDRESS) + - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) + - --v=5 + lifecycle: + preStop: + exec: + command: ["/bin/sh", "-c", "rm -rf /registration/ebs.csi.aws.com-reg.sock /csi/csi.sock"] + env: + - name: ADDRESS + value: unix:/csi/csi.sock + - name: DRIVER_REG_SOCK_PATH + value: C:\var\lib\kubelet\plugins\ebs.csi.aws.com\csi.sock + volumeMounts: + - name: plugin-dir + mountPath: C:\csi + - name: registration-dir + mountPath: C:\registration + {{- if .Values.node.resources }} + {{- with .Values.node.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- else }} + {{- with .Values.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- end }} + - name: liveness-probe + image: {{ printf "%s:%s" .Values.sidecars.livenessProbeImage.repository .Values.sidecars.livenessProbeImage.tag }} + args: + - --csi-address=unix:/csi/csi.sock + volumeMounts: + - name: plugin-dir + mountPath: C:\csi + {{- if .Values.node.resources }} + {{- with .Values.node.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- else }} + {{- with .Values.resources }} + resources: {{ toYaml . | nindent 12 }} + {{- end }} + {{- end }} + {{- if .Values.imagePullSecrets }} + imagePullSecrets: + {{- range .Values.imagePullSecrets }} + - name: {{ . }} + {{- end }} + {{- end }} + volumes: + - name: kubelet-dir + hostPath: + path: C:\var\lib\kubelet + type: Directory + - name: plugin-dir + hostPath: + path: C:\var\lib\kubelet\plugins\ebs.csi.aws.com + type: DirectoryOrCreate + - name: registration-dir + hostPath: + path: C:\var\lib\kubelet\plugins_registry + type: Directory + - name: csi-proxy-disk-pipe + hostPath: + path: \\.\pipe\csi-proxy-disk-v1beta2 + type: "" + - name: csi-proxy-volume-pipe + hostPath: + path: \\.\pipe\csi-proxy-volume-v1beta2 + type: "" + - name: csi-proxy-filesystem-pipe + hostPath: + path: \\.\pipe\csi-proxy-filesystem-v1beta1 + type: "" diff --git a/examples/kubernetes/windows/README.md b/examples/kubernetes/windows/README.md new file mode 100644 index 0000000000..e168d3cd5b --- /dev/null +++ b/examples/kubernetes/windows/README.md @@ -0,0 +1,74 @@ +## Windows + +**This example requires pre-release versions of csi-proxy and the driver that do not exist yet. It is intended for developers only for now. Only basic read/write (mount/unmount and attach/detach) functionality has been tested, other features like resize don't work yet.** + +This example shows how to create a EBS volume and consume it from a Windows container dynamically. + + +## Prerequisites + +1. A 1.18+ Windows node. Windows support has only been tested on 1.18 EKS Windows nodes. https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html +2. [csi-proxy](https://github.com/kubernetes-csi/csi-proxy) vX.Y.Z+ (TODO: no such version exists yet) installed on the Windows node. +3. The driver vX.Y.Z+ (TODO: no such version exists yet) Node plugin (DaemonSet) installed on the Windows node. +4. The driver vX.Y.Z+ (TODO: no such version exists yet) Controller plugin (Deployment) installed on a Linux node. The Controller hasn't been tested on Windows. + +## Usage + +1. Create a sample app along with the StorageClass and the PersistentVolumeClaim: +``` +kubectl apply -f specs/ +``` + +2. Validate the volume was created and `volumeHandle` contains an EBS volumeID: +``` +kubectl describe pv +``` + +3. Validate the pod can write data to the volume: +``` +kubectl exec -it windows-server-iis-7c5fc8f6c5-t5mk9 -- powershell + +PS C:\> New-Item -Path data -Name "testfile1.txt" -ItemType "file" -Value "This +is a text string." + + + Directory: C:\data + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 4/7/2021 12:31 AM 22 testfile1.txt +``` + +4. Validate a different pod can read data from the volume: +``` +kubectl delete po windows-server-iis-7c5fc8f6c5-t5mk9 + +kubectl exec -it windows-server-iis-7c5fc8f6c5-j44qv -- powershell + +PS C:\> ls data + + + Directory: C:\data + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 4/7/2021 12:31 AM 22 testfile1.txt +``` + +5. OPTIONAL: In case you want to run some e2e tests with Windows pods, make sure to cordon Linux nodes for the duration of the test and modify the vpc-admission-webhook so that the Pods created as part of the tests get scheduled to the Windows nodes. +``` +kubectl cordon -l kubernetes.io/os=linux +# edit the webhook such that OSLabelSelectorOverride=all, otherwise the webhook +# won't mutate Pods created by the test and they won't run +kubectl edit deployment -n kube-system vpc-admission-webhook +deployment.apps/vpc-admission-webhook edited +ginkgo -nodes=1 -v --focus="External.Storage.*default.fs.*should.store.data" ./tests/e2e-kubernetes/ -- -kubeconfig=$KUBECONFIG -gce-zone=us-west-2a -node-os-distro=windows +``` + +6. Cleanup resources: +``` +kubectl delete -f specs/ +kubectl uncordon -l kubernetes.io/os=linux +``` diff --git a/examples/kubernetes/windows/specs/windows.yaml b/examples/kubernetes/windows/specs/windows.yaml new file mode 100644 index 0000000000..566e1b47b8 --- /dev/null +++ b/examples/kubernetes/windows/specs/windows.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: windows-server-iis +spec: + selector: + matchLabels: + app: windows-server-iis + tier: backend + track: stable + replicas: 1 + template: + metadata: + labels: + app: windows-server-iis + tier: backend + track: stable + spec: + containers: + - name: windows-server-iis + image: mcr.microsoft.com/windows/servercore:1809 + ports: + - name: http + containerPort: 80 + imagePullPolicy: IfNotPresent + command: + - powershell.exe + - -command + - "Add-WindowsFeature Web-Server; Invoke-WebRequest -UseBasicParsing -Uri 'https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.6/ServiceMonitor.exe' -OutFile 'C:\\ServiceMonitor.exe'; echo '

Hello EKS!!!

' > C:\\inetpub\\wwwroot\\default.html; C:\\ServiceMonitor.exe 'w3svc'; " + volumeMounts: + - name: persistent-storage + mountPath: C:\data + nodeSelector: + kubernetes.io/os: windows + volumes: + - name: persistent-storage + persistentVolumeClaim: + claimName: ebs-claim +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ebs-claim +spec: + storageClassName: windows + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 4Gi +--- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: windows +provisioner: ebs.csi.aws.com +volumeBindingMode: WaitForFirstConsumer +parameters: + fstype: ntfs From 51f9f71c0cc5a01d4f80429c58ebd36c4e0070f8 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Thu, 3 Jun 2021 14:48:20 -0700 Subject: [PATCH 31/59] Sync node-windows.yaml with latest (linux) node.yaml --- .../templates/node-windows.yaml | 30 ++++++++++++++----- examples/kubernetes/windows/README.md | 2 +- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/node-windows.yaml b/charts/aws-ebs-csi-driver/templates/node-windows.yaml index 9408db42d0..b6cde40d7b 100644 --- a/charts/aws-ebs-csi-driver/templates/node-windows.yaml +++ b/charts/aws-ebs-csi-driver/templates/node-windows.yaml @@ -33,20 +33,24 @@ spec: {{- with .Values.node.nodeSelector }} {{ toYaml . | indent 8 }} {{- end }} - # hostNetwork: true serviceAccountName: {{ .Values.serviceAccount.node.name }} priorityClassName: {{ .Values.node.priorityClassName | default "system-cluster-critical" }} tolerations: {{- if .Values.node.tolerateAllTaints }} - operator: Exists + {{- else }} + - key: CriticalAddonsOnly + operator: Exists + - operator: Exists + effect: NoExecute + tolerationSeconds: 300 {{- end }} {{- with .Values.node.tolerations }} {{ toYaml . | indent 8 }} {{- end }} containers: - name: ebs-plugin - image: public.ecr.aws/b5w6x5z2/aws-ebs-csi-driver:windows - imagePullPolicy: Always + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} args: - node - --endpoint=$(CSI_ENDPOINT) @@ -58,6 +62,14 @@ spec: env: - name: CSI_ENDPOINT value: unix:/csi/csi.sock +{{- if .Values.proxy.http_proxy }} + - name: HTTP_PROXY + value: {{ .Values.proxy.http_proxy | quote }} + - name: HTTPS_PROXY + value: {{ .Values.proxy.http_proxy | quote }} + - name: NO_PROXY + value: {{ .Values.proxy.no_proxy | quote }} +{{- end }} volumeMounts: - name: kubelet-dir mountPath: C:\var\lib\kubelet @@ -97,15 +109,19 @@ spec: - --csi-address=$(ADDRESS) - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) - --v=5 - lifecycle: - preStop: - exec: - command: ["/bin/sh", "-c", "rm -rf /registration/ebs.csi.aws.com-reg.sock /csi/csi.sock"] env: - name: ADDRESS value: unix:/csi/csi.sock - name: DRIVER_REG_SOCK_PATH value: C:\var\lib\kubelet\plugins\ebs.csi.aws.com\csi.sock +{{- if .Values.proxy.http_proxy }} + - name: HTTP_PROXY + value: {{ .Values.proxy.http_proxy | quote }} + - name: HTTPS_PROXY + value: {{ .Values.proxy.http_proxy | quote }} + - name: NO_PROXY + value: {{ .Values.proxy.no_proxy | quote }} +{{- end }} volumeMounts: - name: plugin-dir mountPath: C:\csi diff --git a/examples/kubernetes/windows/README.md b/examples/kubernetes/windows/README.md index e168d3cd5b..06f0083ace 100644 --- a/examples/kubernetes/windows/README.md +++ b/examples/kubernetes/windows/README.md @@ -8,7 +8,7 @@ This example shows how to create a EBS volume and consume it from a Windows cont ## Prerequisites 1. A 1.18+ Windows node. Windows support has only been tested on 1.18 EKS Windows nodes. https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html -2. [csi-proxy](https://github.com/kubernetes-csi/csi-proxy) vX.Y.Z+ (TODO: no such version exists yet) installed on the Windows node. +2. [csi-proxy](https://github.com/kubernetes-csi/csi-proxy) built from commit c201c0afb8f12ceac6d5d778270c2702ca563889 or newer installed on the Windows node. 3. The driver vX.Y.Z+ (TODO: no such version exists yet) Node plugin (DaemonSet) installed on the Windows node. 4. The driver vX.Y.Z+ (TODO: no such version exists yet) Controller plugin (Deployment) installed on a Linux node. The Controller hasn't been tested on Windows. From 250aa52b32cc754c7a47f5c376930349336750b3 Mon Sep 17 00:00:00 2001 From: Daniel Wright Date: Tue, 22 Jun 2021 15:22:41 +1000 Subject: [PATCH 32/59] Revert "Fix kustomize RBAC bindings to have namespace kube-system" This reverts commit 3716e5ef3175bdbb6745018f9646957b5a635:eac. --- Makefile | 16 ++++++++-------- .../base/clusterrolebinding-attacher.yaml | 2 +- .../base/clusterrolebinding-csi-node.yaml | 2 +- .../base/clusterrolebinding-provisioner.yaml | 2 +- .../base/clusterrolebinding-resizer.yaml | 2 +- .../clusterrolebinding-snapshot-controller.yaml | 2 +- .../base/clusterrolebinding-snapshotter.yaml | 2 +- ...nding-snapshot-controller-leaderelection.yaml | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 743eabc945..a2e6765f9f 100644 --- a/Makefile +++ b/Makefile @@ -163,19 +163,19 @@ generate-kustomize: bin/helm cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrole-resizer.yaml > ../../deploy/kubernetes/base/clusterrole-resizer.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrole-snapshot-controller.yaml > ../../deploy/kubernetes/base/clusterrole-snapshot-controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrole-snapshotter.yaml > ../../deploy/kubernetes/base/clusterrole-snapshotter.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-attacher.yaml -n kube-system > ../../deploy/kubernetes/base/clusterrolebinding-attacher.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-csi-node.yaml -n kube-system > ../../deploy/kubernetes/base/clusterrolebinding-csi-node.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-provisioner.yaml -n kube-system > ../../deploy/kubernetes/base/clusterrolebinding-provisioner.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-resizer.yaml -n kube-system > ../../deploy/kubernetes/base/clusterrolebinding-resizer.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-snapshot-controller.yaml -n kube-system > ../../deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-snapshotter.yaml -n kube-system > ../../deploy/kubernetes/base/clusterrolebinding-snapshotter.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-attacher.yaml > ../../deploy/kubernetes/base/clusterrolebinding-attacher.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-csi-node.yaml > ../../deploy/kubernetes/base/clusterrolebinding-csi-node.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-provisioner.yaml > ../../deploy/kubernetes/base/clusterrolebinding-provisioner.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-resizer.yaml > ../../deploy/kubernetes/base/clusterrolebinding-resizer.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-snapshot-controller.yaml > ../../deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-snapshotter.yaml > ../../deploy/kubernetes/base/clusterrolebinding-snapshotter.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/controller.yaml > ../../deploy/kubernetes/base/controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/csidriver.yaml > ../../deploy/kubernetes/base/csidriver.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/node.yaml > ../../deploy/kubernetes/base/node.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/poddisruptionbudget-controller.yaml > ../../deploy/kubernetes/base/poddisruptionbudget-controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/poddisruptionbudget-snapshot-controller.yaml -f ../../deploy/kubernetes/values/snapshotter.yaml > ../../deploy/kubernetes/base/poddisruptionbudget-snapshot-controller.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/role-snapshot-controller-leaderelection.yaml -n kube-system > ../../deploy/kubernetes/base/role-snapshot-controller-leaderelection.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/rolebinding-snapshot-controller-leaderelection.yaml -n kube-system > ../../deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/role-snapshot-controller-leaderelection.yaml > ../../deploy/kubernetes/base/role-snapshot-controller-leaderelection.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/rolebinding-snapshot-controller-leaderelection.yaml > ../../deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-csi-controller.yaml > ../../deploy/kubernetes/base/serviceaccount-csi-controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-csi-node.yaml > ../../deploy/kubernetes/base/serviceaccount-csi-node.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-snapshot-controller.yaml > ../../deploy/kubernetes/base/serviceaccount-snapshot-controller.yaml diff --git a/deploy/kubernetes/base/clusterrolebinding-attacher.yaml b/deploy/kubernetes/base/clusterrolebinding-attacher.yaml index 9a97b8efcb..5715d2651b 100644 --- a/deploy/kubernetes/base/clusterrolebinding-attacher.yaml +++ b/deploy/kubernetes/base/clusterrolebinding-attacher.yaml @@ -9,7 +9,7 @@ metadata: subjects: - kind: ServiceAccount name: ebs-csi-controller-sa - namespace: kube-system + namespace: default roleRef: kind: ClusterRole name: ebs-external-attacher-role diff --git a/deploy/kubernetes/base/clusterrolebinding-csi-node.yaml b/deploy/kubernetes/base/clusterrolebinding-csi-node.yaml index d1292b132d..095db52510 100644 --- a/deploy/kubernetes/base/clusterrolebinding-csi-node.yaml +++ b/deploy/kubernetes/base/clusterrolebinding-csi-node.yaml @@ -9,7 +9,7 @@ metadata: subjects: - kind: ServiceAccount name: ebs-csi-node-sa - namespace: kube-system + namespace: default roleRef: kind: ClusterRole name: ebs-csi-node-role diff --git a/deploy/kubernetes/base/clusterrolebinding-provisioner.yaml b/deploy/kubernetes/base/clusterrolebinding-provisioner.yaml index 084bed9df9..3544bc61e2 100644 --- a/deploy/kubernetes/base/clusterrolebinding-provisioner.yaml +++ b/deploy/kubernetes/base/clusterrolebinding-provisioner.yaml @@ -9,7 +9,7 @@ metadata: subjects: - kind: ServiceAccount name: ebs-csi-controller-sa - namespace: kube-system + namespace: default roleRef: kind: ClusterRole name: ebs-external-provisioner-role diff --git a/deploy/kubernetes/base/clusterrolebinding-resizer.yaml b/deploy/kubernetes/base/clusterrolebinding-resizer.yaml index a840f51b83..c80a9a26bf 100644 --- a/deploy/kubernetes/base/clusterrolebinding-resizer.yaml +++ b/deploy/kubernetes/base/clusterrolebinding-resizer.yaml @@ -9,7 +9,7 @@ metadata: subjects: - kind: ServiceAccount name: ebs-csi-controller-sa - namespace: kube-system + namespace: default roleRef: kind: ClusterRole name: ebs-external-resizer-role diff --git a/deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml b/deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml index 10c021c889..6d7cbec1b3 100644 --- a/deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml +++ b/deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml @@ -9,7 +9,7 @@ metadata: subjects: - kind: ServiceAccount name: ebs-snapshot-controller - namespace: kube-system + namespace: default roleRef: kind: ClusterRole name: ebs-snapshot-controller-role diff --git a/deploy/kubernetes/base/clusterrolebinding-snapshotter.yaml b/deploy/kubernetes/base/clusterrolebinding-snapshotter.yaml index 7720ca5d23..7946414d59 100644 --- a/deploy/kubernetes/base/clusterrolebinding-snapshotter.yaml +++ b/deploy/kubernetes/base/clusterrolebinding-snapshotter.yaml @@ -9,7 +9,7 @@ metadata: subjects: - kind: ServiceAccount name: ebs-csi-controller-sa - namespace: kube-system + namespace: default roleRef: kind: ClusterRole name: ebs-external-snapshotter-role diff --git a/deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml b/deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml index 9d66443b9a..fd9ab78b4b 100644 --- a/deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml +++ b/deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml @@ -9,7 +9,7 @@ metadata: subjects: - kind: ServiceAccount name: ebs-snapshot-controller - namespace: kube-system + namespace: default roleRef: kind: Role name: ebs-snapshot-controller-leaderelection From a991210a421c38c5a3612ae9e2cea4b00edb634f Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 22 Jun 2021 15:09:50 -0700 Subject: [PATCH 33/59] Stop pushing latest tag and remove all references to it --- .github/workflows/container-image.yaml | 3 ++- Makefile | 22 ------------------- .../overlays/dev/kustomization.yaml | 7 ------ deploy/kubernetes/values/node.yaml | 2 -- docs/README.md | 5 ----- hack/prow.sh | 2 -- 6 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 deploy/kubernetes/overlays/dev/kustomization.yaml delete mode 100644 deploy/kubernetes/values/node.yaml diff --git a/.github/workflows/container-image.yaml b/.github/workflows/container-image.yaml index 9a0e1e50e4..094a439444 100644 --- a/.github/workflows/container-image.yaml +++ b/.github/workflows/container-image.yaml @@ -37,9 +37,10 @@ jobs: - name: Set environment variables run: | BRANCH=$(echo $GITHUB_REF | cut -d'/' -f3) + SHORT_SHA=$(echo $GITHUB_SHA | cut -c -7) echo "BRANCH=$BRANCH" >> $GITHUB_ENV if [ "$BRANCH" = "master" ]; then - TAG="latest" + TAG=$SHORT_SHA else TAG=$BRANCH fi diff --git a/Makefile b/Makefile index a2e6765f9f..e6693aa4da 100644 --- a/Makefile +++ b/Makefile @@ -125,28 +125,6 @@ test-e2e-external-eks: GINKGO_SKIP="\[Disruptive\]|\[Serial\]" \ ./hack/e2e/run.sh -.PHONY: image-release -image-release: - docker build -t $(IMAGE):$(VERSION) . --target debian-base - docker build -t $(IMAGE):$(VERSION_AMAZONLINUX) . --target amazonlinux - -.PHONY: image -image: - docker build -t $(IMAGE):latest . --target debian-base - -.PHONY: image-amazonlinux -image-amazonlinux: - docker build -t $(IMAGE):latest . --target amazonlinux - -.PHONY: push-release -push-release: - docker push $(IMAGE):$(VERSION) - docker push $(IMAGE):$(VERSION_AMAZONLINUX) - -.PHONY: push -push: - docker push $(IMAGE):latest - .PHONY: verify-vendor test: verify-vendor verify: verify-vendor diff --git a/deploy/kubernetes/overlays/dev/kustomization.yaml b/deploy/kubernetes/overlays/dev/kustomization.yaml deleted file mode 100644 index b4cd8d087c..0000000000 --- a/deploy/kubernetes/overlays/dev/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -bases: - - ../../base -images: - - name: gcr.io/k8s-staging-provider-aws/aws-ebs-csi-driver - newTag: latest diff --git a/deploy/kubernetes/values/node.yaml b/deploy/kubernetes/values/node.yaml deleted file mode 100644 index 39afc69d27..0000000000 --- a/deploy/kubernetes/values/node.yaml +++ /dev/null @@ -1,2 +0,0 @@ -image: - tag: latest \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index f99180ddc1..f199e65a42 100644 --- a/docs/README.md +++ b/docs/README.md @@ -96,7 +96,6 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll ## Container Images: |AWS EBS CSI Driver Version | Image | |---------------------------|--------------------------------------------------| -|master branch |amazon/aws-ebs-csi-driver:latest | |v1.1.0 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.0 | |v1.0.0 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.0.0 | |v0.10.1 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v0.10.1| @@ -227,10 +226,6 @@ Please see [Release Process](./RELEASE.md). * EC2 instance is required to run integration test, since it is exercising the actual flow of creating EBS volume, attaching it and read/write on the disk. See [Integration Testing](../tests/integration/README.md) for more details. * E2E tests exercises various driver functionalities in Kubernetes cluster. See [E2E Testing](../tests/e2e/README.md) for more details. -### Build and Publish Container Image -* Build image and push it with latest tag: `make image && make push` -* Build image and push it with release tag: `make image-release && make push-release` - ### Helm and manifests The helm chart for this project is in the `charts/aws-ebs-csi-driver` directory. The manifests for this project are in the `deploy/kubernetes` directory. All of the manifests except kustomize patches are generated by running `helm template`. This keeps the helm chart and the manifests in sync. diff --git a/hack/prow.sh b/hack/prow.sh index 2cdebf741c..4c99a0c0c9 100755 --- a/hack/prow.sh +++ b/hack/prow.sh @@ -42,7 +42,6 @@ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes loudecho "Build and push debian target" docker buildx build \ --tag="${REGISTRY_NAME}"/aws-ebs-csi-driver:"${GIT_TAG}" \ - --tag="${REGISTRY_NAME}"/aws-ebs-csi-driver:latest \ --platform=linux/arm64,linux/amd64 \ --progress=plain \ --push=true \ @@ -52,7 +51,6 @@ docker buildx build \ loudecho "Build and push amazonlinux target" docker buildx build \ --tag="${REGISTRY_NAME}"/aws-ebs-csi-driver:"${GIT_TAG}"-amazonlinux \ - --tag="${REGISTRY_NAME}"/aws-ebs-csi-driver:latest-amazonlinux \ --platform=linux/arm64,linux/amd64 \ --progress=plain \ --push=true \ From 3ca4d85c43fb866d74248fae3a15ae0a0442afae Mon Sep 17 00:00:00 2001 From: Ricardo Rosales Date: Tue, 22 Jun 2021 17:24:40 -0500 Subject: [PATCH 34/59] Renamed crds/snapshot-controller.yaml -> crds/snapshot-controller-crds.yaml --- Makefile | 2 +- .../{snapshot-controller.yaml => snapshot-controller-crds.yaml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename charts/aws-ebs-csi-driver/crds/{snapshot-controller.yaml => snapshot-controller-crds.yaml} (100%) diff --git a/Makefile b/Makefile index 7fe4c46c10..f954b94259 100644 --- a/Makefile +++ b/Makefile @@ -175,4 +175,4 @@ generate-kustomize: bin/helm cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-csi-node.yaml > ../../deploy/kubernetes/base/serviceaccount-csi-node.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-snapshot-controller.yaml > ../../deploy/kubernetes/base/serviceaccount-snapshot-controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/snapshot-controller.yaml -f ../../deploy/kubernetes/values/snapshotter.yaml > ../../deploy/kubernetes/base/snapshot_controller.yaml - cd charts/aws-ebs-csi-driver && mkdir -p ../../deploy/kubernetes/cluster && cp crds/snapshot-controller.yaml ../../deploy/kubernetes/cluster/crd_snapshotter.yaml + cd charts/aws-ebs-csi-driver && mkdir -p ../../deploy/kubernetes/cluster && cp crds/snapshot-controller-crds.yaml ../../deploy/kubernetes/cluster/snapshot-controller-crds.yaml diff --git a/charts/aws-ebs-csi-driver/crds/snapshot-controller.yaml b/charts/aws-ebs-csi-driver/crds/snapshot-controller-crds.yaml similarity index 100% rename from charts/aws-ebs-csi-driver/crds/snapshot-controller.yaml rename to charts/aws-ebs-csi-driver/crds/snapshot-controller-crds.yaml From 44184d9796a6b0c844d524ff1a043f5ee00f6b9f Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 23 Jun 2021 13:51:45 -0700 Subject: [PATCH 35/59] Clarify that using instance profile for permission requires instance metadata access on --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index f99180ddc1..25ad6ee5ce 100644 --- a/docs/README.md +++ b/docs/README.md @@ -131,7 +131,7 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll ## Installation #### Set up driver permission The driver requires IAM permission to talk to Amazon EBS to manage the volume on user's behalf. [The example policy here](./example-iam-policy.json) defines these permissions. There are several methods to grant the driver IAM permission: -* Using IAM [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) - attach the policy to the instance profile IAM role for the instance(s) on which the driver Deployment will run +* Using IAM [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) - attach the policy to the instance profile IAM role and turn on access to [instance metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for the instance(s) on which the driver Deployment will run * EKS only: Using [IAM roles for ServiceAccounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) - create an IAM role, attach the policy to it, then follow the IRSA documentation to associate the IAM role with the driver Deployment service account, which if you are installing via helm is determined by value `serviceAccount.controller.name`, `ebs-csi-controller-sa` by default * Using secret object - create an IAM user, attach the policy to it, put that user's credentials in [secret manifest](../deploy/kubernetes/secret.yaml), then deploy the secret ```sh From fbda2a0005b56f5624a6b661c125cda8218aaea8 Mon Sep 17 00:00:00 2001 From: Ricardo Rosales Date: Thu, 1 Jul 2021 15:58:27 -0500 Subject: [PATCH 36/59] [helm-chart] csi-snapshotter in ebs-csi-controller now checks for enableVolumeSnapshot before including it in containers --- charts/aws-ebs-csi-driver/templates/controller.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index 0ead9c8662..6eeff032d1 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -189,6 +189,7 @@ spec: resources: {{- toYaml . | nindent 12 }} {{- end }} +{{- if or .Values.enableVolumeSnapshot (.Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1") }} - name: csi-snapshotter image: {{ printf "%s:%s" .Values.sidecars.snapshotterImage.repository .Values.sidecars.snapshotterImage.tag }} args: @@ -210,6 +211,7 @@ spec: resources: {{- toYaml . | nindent 12 }} {{- end }} +{{- end }} - name: csi-resizer image: {{ printf "%s:%s" .Values.sidecars.resizerImage.repository .Values.sidecars.resizerImage.tag }} imagePullPolicy: Always From 8f15cf359038f23d18672cc8ef18208a62e9cc55 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Thu, 1 Jul 2021 12:34:55 -0700 Subject: [PATCH 37/59] Release v1.1.1 and chart v1.2.4 --- CHANGELOG-0.x.md | 5 +++++ Makefile | 2 +- charts/aws-ebs-csi-driver/CHANGELOG.md | 6 ++++++ charts/aws-ebs-csi-driver/Chart.yaml | 4 ++-- charts/aws-ebs-csi-driver/values.yaml | 2 +- deploy/kubernetes/base/controller.yaml | 2 +- deploy/kubernetes/base/node.yaml | 2 +- deploy/kubernetes/overlays/stable/ecr/kustomization.yaml | 2 +- deploy/kubernetes/overlays/stable/kustomization.yaml | 2 +- docs/README.md | 3 ++- 10 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 charts/aws-ebs-csi-driver/CHANGELOG.md diff --git a/CHANGELOG-0.x.md b/CHANGELOG-0.x.md index 8b209f3a20..a5fd0400ac 100644 --- a/CHANGELOG-0.x.md +++ b/CHANGELOG-0.x.md @@ -1,3 +1,8 @@ +# v1.1.1 + +### Bug fixes +- update inFlight cache to avoid race condition on volume operation ([#924])(https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/924), [@AndyXiangLi](https://github.com/AndyXiangLi)) + # v1.1.0 ## Notable changes diff --git a/Makefile b/Makefile index 47fdc16dea..6ad5d09587 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ PKG=github.com/kubernetes-sigs/aws-ebs-csi-driver IMAGE?=amazon/aws-ebs-csi-driver -VERSION=v1.0.0 +VERSION=v1.1.1 VERSION_AMAZONLINUX=$(VERSION)-amazonlinux GIT_COMMIT?=$(shell git rev-parse HEAD) BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") diff --git a/charts/aws-ebs-csi-driver/CHANGELOG.md b/charts/aws-ebs-csi-driver/CHANGELOG.md new file mode 100644 index 0000000000..b82cf8631f --- /dev/null +++ b/charts/aws-ebs-csi-driver/CHANGELOG.md @@ -0,0 +1,6 @@ +# Helm chart + +# v1.2.4 +* Bump app/driver version to `v1.1.1` +* Install VolumeSnapshotClass, VolumeSnapshotContent, VolumeSnapshot CRDs if enableVolumeSnapshot is true +* Only run csi-snapshotter sidecar if enableVolumeSnapshot is true or if CRDs are already installed diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index 003c573ce5..fdba841218 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -appVersion: "1.1.0" +appVersion: "1.1.1" name: aws-ebs-csi-driver description: A Helm chart for AWS EBS CSI Driver -version: 1.2.3 +version: 1.2.4 kubeVersion: ">=1.17.0-0" home: https://github.com/kubernetes-sigs/aws-ebs-csi-driver sources: diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index a33fda9db4..8a6e62a397 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -4,7 +4,7 @@ image: repository: k8s.gcr.io/provider-aws/aws-ebs-csi-driver - tag: "v1.1.0" + tag: "v1.1.1" pullPolicy: IfNotPresent sidecars: diff --git a/deploy/kubernetes/base/controller.yaml b/deploy/kubernetes/base/controller.yaml index 9889a0276d..a038c16589 100644 --- a/deploy/kubernetes/base/controller.yaml +++ b/deploy/kubernetes/base/controller.yaml @@ -31,7 +31,7 @@ spec: tolerationSeconds: 300 containers: - name: ebs-plugin - image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.0 + image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.1 imagePullPolicy: IfNotPresent args: # - {all,controller,node} # specify the driver mode diff --git a/deploy/kubernetes/base/node.yaml b/deploy/kubernetes/base/node.yaml index 1ef6eba112..d48a55f93c 100644 --- a/deploy/kubernetes/base/node.yaml +++ b/deploy/kubernetes/base/node.yaml @@ -41,7 +41,7 @@ spec: - name: ebs-plugin securityContext: privileged: true - image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.0 + image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.1 args: - node - --endpoint=$(CSI_ENDPOINT) diff --git a/deploy/kubernetes/overlays/stable/ecr/kustomization.yaml b/deploy/kubernetes/overlays/stable/ecr/kustomization.yaml index d36d7ca71e..e5f2a1ddf4 100644 --- a/deploy/kubernetes/overlays/stable/ecr/kustomization.yaml +++ b/deploy/kubernetes/overlays/stable/ecr/kustomization.yaml @@ -5,7 +5,7 @@ bases: images: - name: k8s.gcr.io/provider-aws/aws-ebs-csi-driver newName: 602401143452.dkr.ecr.us-west-2.amazonaws.com/eks/aws-ebs-csi-driver - newTag: v1.0.0 + newTag: v1.1.1 - name: k8s.gcr.io/sig-storage/csi-provisioner newName: public.ecr.aws/eks-distro/kubernetes-csi/external-provisioner newTag: v2.1.1-eks-1-18-3 diff --git a/deploy/kubernetes/overlays/stable/kustomization.yaml b/deploy/kubernetes/overlays/stable/kustomization.yaml index 36f0134e75..50ced3ef5d 100644 --- a/deploy/kubernetes/overlays/stable/kustomization.yaml +++ b/deploy/kubernetes/overlays/stable/kustomization.yaml @@ -4,7 +4,7 @@ bases: - ../../base images: - name: k8s.gcr.io/provider-aws/aws-ebs-csi-driver - newTag: v1.1.0 + newTag: v1.1.1 - name: k8s.gcr.io/sig-storage/csi-provisioner newTag: v2.1.1 - name: k8s.gcr.io/sig-storage/csi-attacher diff --git a/docs/README.md b/docs/README.md index 9463315df4..85fc235920 100644 --- a/docs/README.md +++ b/docs/README.md @@ -12,7 +12,7 @@ The [Amazon Elastic Block Store](https://aws.amazon.com/ebs/) Container Storage | AWS EBS CSI Driver \ CSI Version | v0.3.0| v1.0.0 | v1.1.0 | |----------------------------------------|-------|--------|--------| | master branch | no | no | yes | -| v1.1.0 | no | no | yes | +| v1.1.x | no | no | yes | | v1.0.0 | no | no | yes | | v0.10.x | no | no | yes | | v0.9.x | no | no | yes | @@ -96,6 +96,7 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll ## Container Images: |AWS EBS CSI Driver Version | Image | |---------------------------|--------------------------------------------------| +|v1.1.1 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.1 | |v1.1.0 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.1.0 | |v1.0.0 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.0.0 | |v0.10.1 |k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v0.10.1| From e0938d07dd608c6fc9e43b664f92f00acf6f99e1 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 6 Jul 2021 16:00:48 -0700 Subject: [PATCH 38/59] Download fixed version of eksctl to avoid bugs --- hack/e2e/eksctl.sh | 3 ++- hack/e2e/run.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hack/e2e/eksctl.sh b/hack/e2e/eksctl.sh index a4c7f2011b..a185f7f2e7 100644 --- a/hack/e2e/eksctl.sh +++ b/hack/e2e/eksctl.sh @@ -4,8 +4,9 @@ set -euo pipefail function eksctl_install() { INSTALL_PATH=${1} + EKSCTL_VERSION=${2} if [[ ! -e ${INSTALL_PATH}/eksctl ]]; then - EKSCTL_DOWNLOAD_URL="https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" + EKSCTL_DOWNLOAD_URL="https://github.com/weaveworks/eksctl/releases/download/${EKSCTL_VERSION}/eksctl_$(uname -s)_amd64.tar.gz" curl --silent --location "${EKSCTL_DOWNLOAD_URL}" | tar xz -C "${INSTALL_PATH}" chmod +x "${INSTALL_PATH}"/eksctl fi diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 2a1a27f172..3576843493 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -57,6 +57,7 @@ KOPS_STATE_FILE=${KOPS_STATE_FILE:-s3://k8s-kops-csi-e2e} KOPS_PATCH_FILE=${KOPS_PATCH_FILE:-./hack/kops-patch.yaml} KOPS_PATCH_NODE_FILE=${KOPS_PATCH_NODE_FILE:-./hack/kops-patch-node.yaml} +EKSCTL_VERSION=${EKSCTL_VERSION:-0.56.0-rc.1} EKSCTL_PATCH_FILE=${EKSCTL_PATCH_FILE:-./hack/eksctl-patch.yaml} EKSCTL_ADMIN_ROLE=${EKSCTL_ADMIN_ROLE:-} @@ -84,8 +85,8 @@ if [[ "${CLUSTER_TYPE}" == "kops" ]]; then kops_install "${BIN_DIR}" "${KOPS_VERSION}" KOPS_BIN=${BIN_DIR}/kops elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then - loudecho "Installing eksctl latest to ${BIN_DIR}" - eksctl_install "${BIN_DIR}" + loudecho "Installing eksctl ${EKSCTL_VERSION} to ${BIN_DIR}" + eksctl_install "${BIN_DIR}" "${EKSCTL_VERSION}" EKSCTL_BIN=${BIN_DIR}/eksctl else loudecho "${CLUSTER_TYPE} must be kops or eksctl!" From c938f0e88a78664214308c146ffdeed52d8cb1a9 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 7 Jul 2021 14:10:15 -0700 Subject: [PATCH 39/59] Install snapshot controller independently of helm for e2e tests --- Makefile | 5 +++++ hack/e2e/run.sh | 23 ++++++++++++++++++----- hack/values.yaml | 1 - 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 47fdc16dea..ead6c22bd7 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ test-e2e-single-az: AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a \ HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ + EBS_INSTALL_SNAPSHOT="true" \ TEST_PATH=./tests/e2e/... \ GINKGO_FOCUS="\[ebs-csi-e2e\] \[single-az\]" \ GINKGO_SKIP="\"sc1\"|\"st1\"" \ @@ -92,6 +93,7 @@ test-e2e-multi-az: AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \ HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ + EBS_INSTALL_SNAPSHOT="true" \ TEST_PATH=./tests/e2e/... \ GINKGO_FOCUS="\[ebs-csi-e2e\] \[multi-az\]" \ ./hack/e2e/run.sh @@ -101,6 +103,7 @@ test-e2e-migration: AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \ HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ + EBS_INSTALL_SNAPSHOT="true" \ TEST_PATH=./tests/e2e-kubernetes/... \ GINKGO_FOCUS="\[ebs-csi-migration\]" \ EBS_CHECK_MIGRATION=true \ @@ -111,6 +114,7 @@ test-e2e-external: AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b,us-west-2c \ HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ + EBS_INSTALL_SNAPSHOT="true" \ TEST_PATH=./tests/e2e-kubernetes/... \ GINKGO_FOCUS="External.Storage" \ GINKGO_SKIP="\[Disruptive\]|\[Serial\]" \ @@ -122,6 +126,7 @@ test-e2e-external-eks: K8S_VERSION="1.20" \ HELM_VALUES_FILE="./hack/values_eksctl.yaml" \ HELM_EXTRA_FLAGS='--set=controller.k8sTagClusterId=$$CLUSTER_NAME' \ + EBS_INSTALL_SNAPSHOT="true" \ EKSCTL_ADMIN_ROLE="Infra-prod-KopsDeleteAllLambdaServiceRoleF1578477-1ELDFIB4KCMXV" \ AWS_REGION=us-west-2 \ AWS_AVAILABILITY_ZONES=us-west-2a,us-west-2b \ diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 3576843493..9de96cf4ee 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -50,9 +50,9 @@ IMAGE_TAG=${IMAGE_TAG:-${TEST_ID}} # kops: must include patch version (e.g. 1.19.1) # eksctl: mustn't include patch version (e.g. 1.19) -K8S_VERSION=${K8S_VERSION:-1.20.6} +K8S_VERSION=${K8S_VERSION:-1.20.8} -KOPS_VERSION=${KOPS_VERSION:-1.20.0} +KOPS_VERSION=${KOPS_VERSION:-1.21.0} KOPS_STATE_FILE=${KOPS_STATE_FILE:-s3://k8s-kops-csi-e2e} KOPS_PATCH_FILE=${KOPS_PATCH_FILE:-./hack/kops-patch.yaml} KOPS_PATCH_NODE_FILE=${KOPS_PATCH_NODE_FILE:-./hack/kops-patch-node.yaml} @@ -71,7 +71,8 @@ GINKGO_SKIP=${GINKGO_SKIP:-"\[Disruptive\]"} GINKGO_NODES=${GINKGO_NODES:-4} TEST_EXTRA_FLAGS=${TEST_EXTRA_FLAGS:-} -EBS_SNAPSHOT_CRD=${EBS_SNAPSHOT_CRD:-"./deploy/kubernetes/cluster/crd_snapshotter.yaml"} +EBS_INSTALL_SNAPSHOT=${EBS_INSTALL_SNAPSHOT:-"false"} +EBS_INSTALL_SNAPSHOT_VERSION=${EBS_INSTALL_SNAPSHOT_VERSION:-"v4.1.1"} EBS_CHECK_MIGRATION=${EBS_CHECK_MIGRATION:-"false"} CLEAN=${CLEAN:-"true"} @@ -144,6 +145,15 @@ elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then fi fi +if [[ "${EBS_INSTALL_SNAPSHOT}" == true ]]; then + loudecho "Installing snapshot controller and CRDs" + kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml + kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml + kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml + kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml + kubectl apply --kubeconfig "${KUBECONFIG}" -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/"${EBS_INSTALL_SNAPSHOT_VERSION}"/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml +fi + loudecho "Deploying driver" startSec=$(date +'%s') @@ -154,12 +164,15 @@ HELM_ARGS=(upgrade --install "${DRIVER_NAME}" --wait --kubeconfig "${KUBECONFIG}" ./charts/"${DRIVER_NAME}") -if test -f "$HELM_VALUES_FILE"; then +if [[ -f "$HELM_VALUES_FILE" ]]; then HELM_ARGS+=(-f "${HELM_VALUES_FILE}") fi eval "EXPANDED_HELM_EXTRA_FLAGS=$HELM_EXTRA_FLAGS" +if [[ -n "$EXPANDED_HELM_EXTRA_FLAGS" ]]; then + HELM_ARGS+=("${EXPANDED_HELM_EXTRA_FLAGS}") +fi set -x -"${HELM_BIN}" "${HELM_ARGS[@]}" "${EXPANDED_HELM_EXTRA_FLAGS}" +"${HELM_BIN}" "${HELM_ARGS[@]}" set +x endSec=$(date +'%s') diff --git a/hack/values.yaml b/hack/values.yaml index c84cf6e220..253aa649f0 100644 --- a/hack/values.yaml +++ b/hack/values.yaml @@ -1,4 +1,3 @@ -enableVolumeSnapshot: true controller: logLevel: 5 node: From cc90377d97715482616543859028b1b9a953944e Mon Sep 17 00:00:00 2001 From: Michael Katica Date: Thu, 8 Jul 2021 13:26:52 -0400 Subject: [PATCH 40/59] Add ebs-plugin additionalArgs --- charts/aws-ebs-csi-driver/templates/controller.yaml | 3 +++ charts/aws-ebs-csi-driver/values.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index 6eeff032d1..5623cd449d 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -78,6 +78,9 @@ spec: {{- end }} - --logtostderr - --v={{ .Values.controller.logLevel }} + {{- range .Values.controller.additionalArgs }} + - {{ . }} + {{- end }} env: - name: CSI_ENDPOINT value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 8a6e62a397..57e113f3a1 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -59,6 +59,8 @@ tolerations: [] topologySpreadConstraints: [] controller: + # If arbitray args like "--aws-sdk-debug-log=true" need to be passed, use this value + # additionalArgs: [] affinity: {} # True if enable volume scheduling for dynamic volume provisioning env: From 25adfedbdb645ee26a68a8a21afafab1740a6d27 Mon Sep 17 00:00:00 2001 From: Michael Katica Date: Thu, 8 Jul 2021 13:50:29 -0400 Subject: [PATCH 41/59] fixed a typo --- charts/aws-ebs-csi-driver/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 57e113f3a1..f3760cf44b 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -59,7 +59,7 @@ tolerations: [] topologySpreadConstraints: [] controller: - # If arbitray args like "--aws-sdk-debug-log=true" need to be passed, use this value + # If arbitrary args like "--aws-sdk-debug-log=true" need to be passed, use this value # additionalArgs: [] affinity: {} # True if enable volume scheduling for dynamic volume provisioning From 8baf51243daaba86489f3c3caa96504c76a1c3d4 Mon Sep 17 00:00:00 2001 From: Michael Katica Date: Mon, 12 Jul 2021 10:44:51 -0400 Subject: [PATCH 42/59] Uncomment additionalArgs in values --- charts/aws-ebs-csi-driver/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index f3760cf44b..91c25041a5 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -60,7 +60,7 @@ topologySpreadConstraints: [] controller: # If arbitrary args like "--aws-sdk-debug-log=true" need to be passed, use this value - # additionalArgs: [] + additionalArgs: [] affinity: {} # True if enable volume scheduling for dynamic volume provisioning env: From 0bba02a3c8964b50635411409ca28bc77f90c1f9 Mon Sep 17 00:00:00 2001 From: ialidzhikov Date: Mon, 12 Jul 2021 19:02:24 +0300 Subject: [PATCH 43/59] Fix typo in the CHANGELOG Signed-off-by: ialidzhikov --- CHANGELOG-0.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG-0.x.md b/CHANGELOG-0.x.md index a5fd0400ac..2c21d37b26 100644 --- a/CHANGELOG-0.x.md +++ b/CHANGELOG-0.x.md @@ -1,7 +1,7 @@ # v1.1.1 ### Bug fixes -- update inFlight cache to avoid race condition on volume operation ([#924])(https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/924), [@AndyXiangLi](https://github.com/AndyXiangLi)) +- update inFlight cache to avoid race condition on volume operation ([#924](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/924), [@AndyXiangLi](https://github.com/AndyXiangLi)) # v1.1.0 From 82a010e575e5361df84fc55f8baf589bb72b371e Mon Sep 17 00:00:00 2001 From: Kyle Michel Date: Mon, 5 Jul 2021 15:59:24 -0400 Subject: [PATCH 44/59] Remove deprecated values and increase minimum helm version --- charts/aws-ebs-csi-driver/Chart.yaml | 4 +- charts/aws-ebs-csi-driver/templates/NOTES.txt | 36 ------------------ .../aws-ebs-csi-driver/templates/_helpers.tpl | 3 +- .../templates/controller.yaml | 37 +++++++++---------- .../templates/node-windows.yaml | 28 +++----------- charts/aws-ebs-csi-driver/templates/node.yaml | 8 ++-- .../poddisruptionbudget-controller.yaml | 5 +-- charts/aws-ebs-csi-driver/values.yaml | 23 ++---------- 8 files changed, 34 insertions(+), 110 deletions(-) diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index fdba841218..a897dc3ded 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -1,8 +1,8 @@ -apiVersion: v1 +apiVersion: v2 appVersion: "1.1.1" name: aws-ebs-csi-driver description: A Helm chart for AWS EBS CSI Driver -version: 1.2.4 +version: 2.0.0 kubeVersion: ">=1.17.0-0" home: https://github.com/kubernetes-sigs/aws-ebs-csi-driver sources: diff --git a/charts/aws-ebs-csi-driver/templates/NOTES.txt b/charts/aws-ebs-csi-driver/templates/NOTES.txt index 8f6d02ee38..3717647d78 100644 --- a/charts/aws-ebs-csi-driver/templates/NOTES.txt +++ b/charts/aws-ebs-csi-driver/templates/NOTES.txt @@ -1,39 +1,3 @@ To verify that aws-ebs-csi-driver has started, run: kubectl get pod -n {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "aws-ebs-csi-driver.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" - - -WARNING: The following values have been deprecated in favor of moving them into the controller or node groups. They will be removed in a subsequent release. - -affinity: -extraCreateMetadata: -extraVolumeTags: -k8sTagClusterId: -nodeSelector: -podAnnotations: -priorityClassName: -region: -replicaCount: -resources: -tolerations: -topologySpreadConstraints: -volumeAttachLimit: - -are moving to - -controller: - affinity: - extraCreateMetadata: - extraVolumeTags: - k8sTagClusterId: - nodeSelector: - podAnnotations: - priorityClassName: - region: - replicaCount: - resources: - tolerations: - topologySpreadConstraints: - -node: - volumeAttachLimit: diff --git a/charts/aws-ebs-csi-driver/templates/_helpers.tpl b/charts/aws-ebs-csi-driver/templates/_helpers.tpl index ddf7b614d1..c334bd5d0d 100644 --- a/charts/aws-ebs-csi-driver/templates/_helpers.tpl +++ b/charts/aws-ebs-csi-driver/templates/_helpers.tpl @@ -59,9 +59,8 @@ app.kubernetes.io/instance: {{ .Release.Name }} Convert the `--extra-volume-tags` command line arg from a map. */}} {{- define "aws-ebs-csi-driver.extra-volume-tags" -}} -{{- $evt := default .Values.extraVolumeTags .Values.controller.extraVolumeTags }} {{- $result := dict "pairs" (list) -}} -{{- range $key, $value := $evt -}} +{{- range $key, $value := .Values.controller.extraVolumeTags -}} {{- $noop := printf "%s=%s" $key $value | append $result.pairs | set $result "pairs" -}} {{- end -}} {{- if gt (len $result.pairs) 0 -}} diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index 5623cd449d..fd98d344f1 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -6,7 +6,7 @@ metadata: labels: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} spec: - replicas: {{ default .Values.replicaCount .Values.controller.replicaCount }} + replicas: {{ .Values.controller.replicaCount }} selector: matchLabels: app: ebs-csi-controller @@ -22,19 +22,16 @@ spec: {{- if .Values.controller.podAnnotations }} annotations: {{- toYaml .Values.controller.podAnnotations | nindent 8 }} - {{- else if .Values.podAnnotations}} - annotations: - {{- toYaml .Values.podAnnotations | nindent 8 }} {{- end }} spec: nodeSelector: kubernetes.io/os: linux - {{- with default .Values.nodeSelector .Values.controller.nodeSelector }} + {{- with .Values.controller.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ .Values.serviceAccount.controller.name }} - priorityClassName: {{ default .Values.priorityClassName .Values.controller.priorityClassName }} - {{- with default .Values.affinity .Values.controller.affinity }} + priorityClassName: {{ .Values.controller.priorityClassName }} + {{- with default .Values.controller.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} @@ -44,13 +41,13 @@ spec: - operator: Exists effect: NoExecute tolerationSeconds: 300 - {{- with default .Values.tolerations .Values.controller.tolerations }} + {{- with .Values.controller.tolerations }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if or .Values.controller.topologySpreadConstraints .Values.topologySpreadConstraints }} + {{- if .Values.controller.topologySpreadConstraints }} {{- $tscLabelSelector := dict "labelSelector" ( dict "matchLabels" ( dict "app" "ebs-csi-controller" ) ) }} {{- $constraints := list }} - {{- range default .Values.topologySpreadConstraints .Values.controller.topologySpreadConstraints }} + {{- range .Values.controller.topologySpreadConstraints }} {{- $constraints = mustAppend $constraints (mergeOverwrite . $tscLabelSelector) }} {{- end }} topologySpreadConstraints: @@ -67,10 +64,10 @@ spec: # - {all,controller,node} # specify the driver mode {{- end }} - --endpoint=$(CSI_ENDPOINT) - {{- if or .Values.controller.extraVolumeTags .Values.extraVolumeTags }} + {{- if .Values.controller.extraVolumeTags }} {{- include "aws-ebs-csi-driver.extra-volume-tags" . | nindent 12 }} {{- end }} - {{- with default .Values.k8sTagClusterId .Values.controller.k8sTagClusterId }} + {{- with .Values.controller.k8sTagClusterId }} - --k8s-tag-cluster-id={{ . }} {{- end }} {{- with .Values.controller.httpEndpoint }} @@ -100,7 +97,7 @@ spec: name: aws-secret key: access_key optional: true - {{- with default .Values.region .Values.controller.region }} + {{- with .Values.controller.region }} - name: AWS_REGION value: {{ . }} {{- end }} @@ -139,7 +136,7 @@ spec: timeoutSeconds: 3 periodSeconds: 10 failureThreshold: 5 - {{- with default .Values.resources (default .Values.controller.resources .Values.controller.containerResources.ebsPlugin) }} + {{- with default .Values.controller.resources .Values.controller.containerResources.ebsPlugin }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -149,7 +146,7 @@ spec: - --csi-address=$(ADDRESS) - --v=5 - --feature-gates=Topology=true - {{- if or .Values.controller.extraCreateMetadata .Values.extraCreateMetadata }} + {{- if .Values.controller.extraCreateMetadata }} - --extra-create-metadata {{- end}} - --leader-election=true @@ -166,7 +163,7 @@ spec: volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- with default .Values.resources (default .Values.controller.resources .Values.controller.containerResources.provisioner) }} + {{- with default .Values.controller.resources .Values.controller.containerResources.provisioner }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -188,7 +185,7 @@ spec: volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- with default .Values.resources (default .Values.controller.resources .Values.controller.containerResources.attacher) }} + {{- with default .Values.controller.resources .Values.controller.containerResources.attacher }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -210,7 +207,7 @@ spec: volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- with default .Values.resources (default .Values.controller.resources .Values.controller.containerResources.snapshotter) }} + {{- with default .Values.controller.resources .Values.controller.containerResources.snapshotter }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -233,7 +230,7 @@ spec: volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- with default .Values.resources (default .Values.controller.resources .Values.controller.containerResources.resizer) }} + {{- with default .Values.controller.resources .Values.controller.containerResources.resizer }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -244,7 +241,7 @@ spec: volumeMounts: - name: socket-dir mountPath: /csi - {{- with default .Values.resources (default .Values.controller.resources .Values.controller.containerResources.liveness) }} + {{- with default .Values.controller.resources .Values.controller.containerResources.liveness }} resources: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/node-windows.yaml b/charts/aws-ebs-csi-driver/templates/node-windows.yaml index b6cde40d7b..9111d45b25 100644 --- a/charts/aws-ebs-csi-driver/templates/node-windows.yaml +++ b/charts/aws-ebs-csi-driver/templates/node-windows.yaml @@ -54,8 +54,8 @@ spec: args: - node - --endpoint=$(CSI_ENDPOINT) - {{- if .Values.volumeAttachLimit }} - - --volume-attach-limit={{ .Values.volumeAttachLimit }} + {{- with .Values.node.volumeAttachLimit }} + - --volume-attach-limit={{ . }} {{- end }} - --logtostderr - --v=5 @@ -94,15 +94,9 @@ spec: timeoutSeconds: 3 periodSeconds: 10 failureThreshold: 5 - {{- if .Values.node.resources }} - {{- with .Values.node.resources }} + {{- with default .Values.node.resources .Values.node.containerResources.ebsPlugin }} resources: {{ toYaml . | nindent 12 }} {{- end }} - {{- else }} - {{- with .Values.resources }} - resources: {{ toYaml . | nindent 12 }} - {{- end }} - {{- end }} - name: node-driver-registrar image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrarImage.repository .Values.sidecars.nodeDriverRegistrarImage.tag }} args: @@ -127,15 +121,9 @@ spec: mountPath: C:\csi - name: registration-dir mountPath: C:\registration - {{- if .Values.node.resources }} - {{- with .Values.node.resources }} - resources: {{ toYaml . | nindent 12 }} - {{- end }} - {{- else }} - {{- with .Values.resources }} + {{- with default .Values.node.resources .Values.node.containerResources.nodeDriverRegistrar }} resources: {{ toYaml . | nindent 12 }} {{- end }} - {{- end }} - name: liveness-probe image: {{ printf "%s:%s" .Values.sidecars.livenessProbeImage.repository .Values.sidecars.livenessProbeImage.tag }} args: @@ -143,15 +131,9 @@ spec: volumeMounts: - name: plugin-dir mountPath: C:\csi - {{- if .Values.node.resources }} - {{- with .Values.node.resources }} - resources: {{ toYaml . | nindent 12 }} - {{- end }} - {{- else }} - {{- with .Values.resources }} + {{- with default .Values.node.resources .Values.node.containerResources.liveness }} resources: {{ toYaml . | nindent 12 }} {{- end }} - {{- end }} {{- if .Values.imagePullSecrets }} imagePullSecrets: {{- range .Values.imagePullSecrets }} diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index 556710a39a..f24ebae101 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -60,7 +60,7 @@ spec: args: - node - --endpoint=$(CSI_ENDPOINT) - {{- with default .Values.volumeAttachLimit .Values.node.volumeAttachLimit }} + {{- with .Values.node.volumeAttachLimit }} - --volume-attach-limit={{ . }} {{- end }} - --logtostderr @@ -98,7 +98,7 @@ spec: timeoutSeconds: 3 periodSeconds: 10 failureThreshold: 5 - {{- with default .Values.resources (default .Values.node.resources .Values.node.containerResources.ebsPlugin) }} + {{- with default .Values.node.resources .Values.node.containerResources.ebsPlugin }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -124,7 +124,7 @@ spec: mountPath: /csi - name: registration-dir mountPath: /registration - {{- with default .Values.resources (default .Values.node.resources .Values.node.containerResources.nodeDriverRegistrar) }} + {{- with default .Values.node.resources .Values.node.containerResources.nodeDriverRegistrar }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -135,7 +135,7 @@ spec: volumeMounts: - name: plugin-dir mountPath: /csi - {{- with default .Values.resources (default .Values.node.resources .Values.node.containerResources.liveness) }} + {{- with default .Values.node.resources .Values.node.containerResources.liveness }} resources: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/poddisruptionbudget-controller.yaml b/charts/aws-ebs-csi-driver/templates/poddisruptionbudget-controller.yaml index 373974a004..f6241fad9e 100644 --- a/charts/aws-ebs-csi-driver/templates/poddisruptionbudget-controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/poddisruptionbudget-controller.yaml @@ -1,4 +1,3 @@ -{{- $replicas := (default .Values.replicaCount .Values.controller.replicaCount) | int }} apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: @@ -10,8 +9,8 @@ spec: matchLabels: app: ebs-csi-controller {{- include "aws-ebs-csi-driver.selectorLabels" . | nindent 6 }} - {{- if le $replicas 2 }} + {{- if le (.Values.controller.replicaCount | int) 2 }} maxUnavailable: 1 {{- else }} minAvailable: 2 -{{- end }} + {{- end }} diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 91c25041a5..9dbf2daa23 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -44,20 +44,6 @@ fullnameOverride: # True if enable volume snapshot enableVolumeSnapshot: false -# Moving to values under controller -affinity: {} -extraCreateMetadata: true -extraVolumeTags: {} -k8sTagClusterId: -nodeSelector: {} -podAnnotations: {} -priorityClassName: "system-cluster-critical" -region: -replicaCount: 2 -resources: {} -tolerations: [] -topologySpreadConstraints: [] - controller: # If arbitrary args like "--aws-sdk-debug-log=true" need to be passed, use this value additionalArgs: [] @@ -86,13 +72,13 @@ controller: nodeSelector: {} podAnnotations: {} podLabels: {} - priorityClassName: + priorityClassName: system-cluster-critical # AWS region to use. If not specified then the region will be looked up via the AWS EC2 metadata # service. # --- # region: us-east-1 region: - replicaCount: + replicaCount: 2 resources: {} containerResources: ebsPlugin: {} @@ -127,10 +113,6 @@ controller: # whenUnsatisfiable: ScheduleAnyway topologySpreadConstraints: [] -# Moving to values under node -# The "maximum number of attachable volumes" per node -volumeAttachLimit: - node: env: ebsPlugin: [] @@ -148,6 +130,7 @@ node: ebsPlugin: {} nodeDriverRegistrar: {} liveness: {} + # The "maximum number of attachable volumes" per node volumeAttachLimit: serviceAccount: From cb71ab40ab32f1ff8588bcfa37d0cb559c91cfa6 Mon Sep 17 00:00:00 2001 From: Kyle Michel Date: Mon, 5 Jul 2021 17:08:03 -0400 Subject: [PATCH 45/59] Remove installation of snapshot controller and add it as a prerequisite --- Makefile | 10 +- .../crds/snapshot-controller-crds.yaml | 628 ------------------ .../clusterrole-snapshot-controller.yaml | 32 - ...lusterrolebinding-snapshot-controller.yaml | 15 - charts/aws-ebs-csi-driver/templates/crds.yml | 6 - ...ddisruptionbudget-snapshot-controller.yaml | 14 - ...le-snapshot-controller-leaderelection.yaml | 11 - ...ng-snapshot-controller-leaderelection.yaml | 15 - .../serviceaccount-snapshot-controller.yaml | 13 - .../templates/snapshot-controller.yaml | 68 -- charts/aws-ebs-csi-driver/values.yaml | 10 - .../base/clusterrole-snapshot-controller.yaml | 33 - ...lusterrolebinding-snapshot-controller.yaml | 16 - deploy/kubernetes/base/kustomization.yaml | 7 - ...ddisruptionbudget-snapshot-controller.yaml | 14 - ...le-snapshot-controller-leaderelection.yaml | 12 - ...ng-snapshot-controller-leaderelection.yaml | 16 - .../serviceaccount-snapshot-controller.yaml | 8 - .../kubernetes/base/snapshot_controller.yaml | 38 -- docs/README.md | 1 + 20 files changed, 2 insertions(+), 965 deletions(-) delete mode 100644 charts/aws-ebs-csi-driver/crds/snapshot-controller-crds.yaml delete mode 100644 charts/aws-ebs-csi-driver/templates/clusterrole-snapshot-controller.yaml delete mode 100644 charts/aws-ebs-csi-driver/templates/clusterrolebinding-snapshot-controller.yaml delete mode 100644 charts/aws-ebs-csi-driver/templates/crds.yml delete mode 100644 charts/aws-ebs-csi-driver/templates/poddisruptionbudget-snapshot-controller.yaml delete mode 100644 charts/aws-ebs-csi-driver/templates/role-snapshot-controller-leaderelection.yaml delete mode 100644 charts/aws-ebs-csi-driver/templates/rolebinding-snapshot-controller-leaderelection.yaml delete mode 100644 charts/aws-ebs-csi-driver/templates/serviceaccount-snapshot-controller.yaml delete mode 100644 charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml delete mode 100644 deploy/kubernetes/base/clusterrole-snapshot-controller.yaml delete mode 100644 deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml delete mode 100644 deploy/kubernetes/base/poddisruptionbudget-snapshot-controller.yaml delete mode 100644 deploy/kubernetes/base/role-snapshot-controller-leaderelection.yaml delete mode 100644 deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml delete mode 100644 deploy/kubernetes/base/serviceaccount-snapshot-controller.yaml delete mode 100644 deploy/kubernetes/base/snapshot_controller.yaml diff --git a/Makefile b/Makefile index bcb672e526..4c0ebaa036 100644 --- a/Makefile +++ b/Makefile @@ -149,23 +149,15 @@ generate-kustomize: bin/helm cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrole-csi-node.yaml > ../../deploy/kubernetes/base/clusterrole-csi-node.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrole-provisioner.yaml > ../../deploy/kubernetes/base/clusterrole-provisioner.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrole-resizer.yaml > ../../deploy/kubernetes/base/clusterrole-resizer.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrole-snapshot-controller.yaml > ../../deploy/kubernetes/base/clusterrole-snapshot-controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrole-snapshotter.yaml > ../../deploy/kubernetes/base/clusterrole-snapshotter.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-attacher.yaml > ../../deploy/kubernetes/base/clusterrolebinding-attacher.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-csi-node.yaml > ../../deploy/kubernetes/base/clusterrolebinding-csi-node.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-provisioner.yaml > ../../deploy/kubernetes/base/clusterrolebinding-provisioner.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-resizer.yaml > ../../deploy/kubernetes/base/clusterrolebinding-resizer.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-snapshot-controller.yaml > ../../deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-snapshotter.yaml > ../../deploy/kubernetes/base/clusterrolebinding-snapshotter.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/controller.yaml > ../../deploy/kubernetes/base/controller.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/controller.yaml --set enableVolumeSnapshot=true > ../../deploy/kubernetes/base/controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/csidriver.yaml > ../../deploy/kubernetes/base/csidriver.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/node.yaml > ../../deploy/kubernetes/base/node.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/poddisruptionbudget-controller.yaml > ../../deploy/kubernetes/base/poddisruptionbudget-controller.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/poddisruptionbudget-snapshot-controller.yaml -f ../../deploy/kubernetes/values/snapshotter.yaml > ../../deploy/kubernetes/base/poddisruptionbudget-snapshot-controller.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/role-snapshot-controller-leaderelection.yaml > ../../deploy/kubernetes/base/role-snapshot-controller-leaderelection.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/rolebinding-snapshot-controller-leaderelection.yaml > ../../deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-csi-controller.yaml > ../../deploy/kubernetes/base/serviceaccount-csi-controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-csi-node.yaml > ../../deploy/kubernetes/base/serviceaccount-csi-node.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-snapshot-controller.yaml > ../../deploy/kubernetes/base/serviceaccount-snapshot-controller.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/snapshot-controller.yaml -f ../../deploy/kubernetes/values/snapshotter.yaml > ../../deploy/kubernetes/base/snapshot_controller.yaml - cd charts/aws-ebs-csi-driver && mkdir -p ../../deploy/kubernetes/cluster && cp crds/snapshot-controller-crds.yaml ../../deploy/kubernetes/cluster/snapshot-controller-crds.yaml diff --git a/charts/aws-ebs-csi-driver/crds/snapshot-controller-crds.yaml b/charts/aws-ebs-csi-driver/crds/snapshot-controller-crds.yaml deleted file mode 100644 index 6ca2443d83..0000000000 --- a/charts/aws-ebs-csi-driver/crds/snapshot-controller-crds.yaml +++ /dev/null @@ -1,628 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.4.0 - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/419" - creationTimestamp: null - name: volumesnapshotclasses.snapshot.storage.k8s.io -spec: - group: snapshot.storage.k8s.io - names: - kind: VolumeSnapshotClass - listKind: VolumeSnapshotClassList - plural: volumesnapshotclasses - singular: volumesnapshotclass - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .driver - name: Driver - type: string - - description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. - jsonPath: .deletionPolicy - name: DeletionPolicy - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1 - schema: - openAPIV3Schema: - description: VolumeSnapshotClass specifies parameters that a underlying storage system uses when creating a volume snapshot. A specific VolumeSnapshotClass is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses are non-namespaced - properties: - apiVersion: - description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - deletionPolicy: - description: deletionPolicy determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. Required. - enum: - - Delete - - Retain - type: string - driver: - description: driver is the name of the storage driver that handles this VolumeSnapshotClass. Required. - type: string - kind: - description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - parameters: - additionalProperties: - type: string - description: parameters is a key-value map with storage driver specific parameters for creating snapshots. These values are opaque to Kubernetes. - type: object - required: - - deletionPolicy - - driver - type: object - served: true - storage: false - subresources: {} - - additionalPrinterColumns: - - jsonPath: .driver - name: Driver - type: string - - description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. - jsonPath: .deletionPolicy - name: DeletionPolicy - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: VolumeSnapshotClass specifies parameters that a underlying storage system uses when creating a volume snapshot. A specific VolumeSnapshotClass is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses are non-namespaced - properties: - apiVersion: - description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - deletionPolicy: - description: deletionPolicy determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. Required. - enum: - - Delete - - Retain - type: string - driver: - description: driver is the name of the storage driver that handles this VolumeSnapshotClass. Required. - type: string - kind: - description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - parameters: - additionalProperties: - type: string - description: parameters is a key-value map with storage driver specific parameters for creating snapshots. These values are opaque to Kubernetes. - type: object - required: - - deletionPolicy - - driver - type: object - served: true - storage: true - subresources: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.4.0 - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/419" - creationTimestamp: null - name: volumesnapshotcontents.snapshot.storage.k8s.io -spec: - group: snapshot.storage.k8s.io - names: - kind: VolumeSnapshotContent - listKind: VolumeSnapshotContentList - plural: volumesnapshotcontents - singular: volumesnapshotcontent - scope: Cluster - versions: - - additionalPrinterColumns: - - description: Indicates if the snapshot is ready to be used to restore a volume. - jsonPath: .status.readyToUse - name: ReadyToUse - type: boolean - - description: Represents the complete size of the snapshot in bytes - jsonPath: .status.restoreSize - name: RestoreSize - type: integer - - description: Determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system should be deleted when its bound VolumeSnapshot is deleted. - jsonPath: .spec.deletionPolicy - name: DeletionPolicy - type: string - - description: Name of the CSI driver used to create the physical snapshot on the underlying storage system. - jsonPath: .spec.driver - name: Driver - type: string - - description: Name of the VolumeSnapshotClass to which this snapshot belongs. - jsonPath: .spec.volumeSnapshotClassName - name: VolumeSnapshotClass - type: string - - description: Name of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. - jsonPath: .spec.volumeSnapshotRef.name - name: VolumeSnapshot - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1 - schema: - openAPIV3Schema: - description: VolumeSnapshotContent represents the actual "on-disk" snapshot object in the underlying storage system - properties: - apiVersion: - description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - kind: - description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - spec: - description: spec defines properties of a VolumeSnapshotContent created by the underlying storage system. Required. - properties: - deletionPolicy: - description: deletionPolicy determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. For dynamically provisioned snapshots, this field will automatically be filled in by the CSI snapshotter sidecar with the "DeletionPolicy" field defined in the corresponding VolumeSnapshotClass. For pre-existing snapshots, users MUST specify this field when creating the VolumeSnapshotContent object. Required. - enum: - - Delete - - Retain - type: string - driver: - description: driver is the name of the CSI driver used to create the physical snapshot on the underlying storage system. This MUST be the same as the name returned by the CSI GetPluginName() call for that driver. Required. - type: string - source: - description: source specifies whether the snapshot is (or should be) dynamically provisioned or already exists, and just requires a Kubernetes object representation. This field is immutable after creation. Required. - properties: - snapshotHandle: - description: snapshotHandle specifies the CSI "snapshot_id" of a pre-existing snapshot on the underlying storage system for which a Kubernetes object representation was (or should be) created. This field is immutable. - type: string - volumeHandle: - description: volumeHandle specifies the CSI "volume_id" of the volume from which a snapshot should be dynamically taken from. This field is immutable. - type: string - type: object - oneOf: - - required: ["snapshotHandle"] - - required: ["volumeHandle"] - volumeSnapshotClassName: - description: name of the VolumeSnapshotClass from which this snapshot was (or will be) created. Note that after provisioning, the VolumeSnapshotClass may be deleted or recreated with different set of values, and as such, should not be referenced post-snapshot creation. - type: string - volumeSnapshotRef: - description: volumeSnapshotRef specifies the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName field must reference to this VolumeSnapshotContent's name for the bidirectional binding to be valid. For a pre-existing VolumeSnapshotContent object, name and namespace of the VolumeSnapshot object MUST be provided for binding to happen. This field is immutable after creation. Required. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - name: - description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - type: string - namespace: - description: "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" - type: string - resourceVersion: - description: "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" - type: string - uid: - description: "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids" - type: string - type: object - required: - - deletionPolicy - - driver - - source - - volumeSnapshotRef - type: object - status: - description: status represents the current information of a snapshot. - properties: - creationTime: - description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it indicates the creation time is unknown. The format of this field is a Unix nanoseconds time encoded as an int64. On Unix, the command `date +%s%N` returns the current time in nanoseconds since 1970-01-01 00:00:00 UTC. - format: int64 - type: integer - error: - description: error is the last observed error during snapshot creation, if any. Upon success after retry, this error field will be cleared. - properties: - message: - description: "message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information." - type: string - time: - description: time is the timestamp when the error was encountered. - format: date-time - type: string - type: object - readyToUse: - description: readyToUse indicates if a snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown. - type: boolean - restoreSize: - description: restoreSize represents the complete size of the snapshot in bytes. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown. - format: int64 - minimum: 0 - type: integer - snapshotHandle: - description: snapshotHandle is the CSI "snapshot_id" of a snapshot on the underlying storage system. If not specified, it indicates that dynamic snapshot creation has either failed or it is still in progress. - type: string - type: object - required: - - spec - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - description: Indicates if the snapshot is ready to be used to restore a volume. - jsonPath: .status.readyToUse - name: ReadyToUse - type: boolean - - description: Represents the complete size of the snapshot in bytes - jsonPath: .status.restoreSize - name: RestoreSize - type: integer - - description: Determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system should be deleted when its bound VolumeSnapshot is deleted. - jsonPath: .spec.deletionPolicy - name: DeletionPolicy - type: string - - description: Name of the CSI driver used to create the physical snapshot on the underlying storage system. - jsonPath: .spec.driver - name: Driver - type: string - - description: Name of the VolumeSnapshotClass to which this snapshot belongs. - jsonPath: .spec.volumeSnapshotClassName - name: VolumeSnapshotClass - type: string - - description: Name of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. - jsonPath: .spec.volumeSnapshotRef.name - name: VolumeSnapshot - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: VolumeSnapshotContent represents the actual "on-disk" snapshot object in the underlying storage system - properties: - apiVersion: - description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - kind: - description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - spec: - description: spec defines properties of a VolumeSnapshotContent created by the underlying storage system. Required. - properties: - deletionPolicy: - description: deletionPolicy determines whether this VolumeSnapshotContent and its physical snapshot on the underlying storage system should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. For dynamically provisioned snapshots, this field will automatically be filled in by the CSI snapshotter sidecar with the "DeletionPolicy" field defined in the corresponding VolumeSnapshotClass. For pre-existing snapshots, users MUST specify this field when creating the VolumeSnapshotContent object. Required. - enum: - - Delete - - Retain - type: string - driver: - description: driver is the name of the CSI driver used to create the physical snapshot on the underlying storage system. This MUST be the same as the name returned by the CSI GetPluginName() call for that driver. Required. - type: string - source: - description: source specifies whether the snapshot is (or should be) dynamically provisioned or already exists, and just requires a Kubernetes object representation. This field is immutable after creation. Required. - properties: - snapshotHandle: - description: snapshotHandle specifies the CSI "snapshot_id" of a pre-existing snapshot on the underlying storage system for which a Kubernetes object representation was (or should be) created. This field is immutable. - type: string - volumeHandle: - description: volumeHandle specifies the CSI "volume_id" of the volume from which a snapshot should be dynamically taken from. This field is immutable. - type: string - type: object - volumeSnapshotClassName: - description: name of the VolumeSnapshotClass from which this snapshot was (or will be) created. Note that after provisioning, the VolumeSnapshotClass may be deleted or recreated with different set of values, and as such, should not be referenced post-snapshot creation. - type: string - volumeSnapshotRef: - description: volumeSnapshotRef specifies the VolumeSnapshot object to which this VolumeSnapshotContent object is bound. VolumeSnapshot.Spec.VolumeSnapshotContentName field must reference to this VolumeSnapshotContent's name for the bidirectional binding to be valid. For a pre-existing VolumeSnapshotContent object, name and namespace of the VolumeSnapshot object MUST be provided for binding to happen. This field is immutable after creation. Required. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' - type: string - kind: - description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - name: - description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - type: string - namespace: - description: "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" - type: string - resourceVersion: - description: "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" - type: string - uid: - description: "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids" - type: string - type: object - required: - - deletionPolicy - - driver - - source - - volumeSnapshotRef - type: object - status: - description: status represents the current information of a snapshot. - properties: - creationTime: - description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it indicates the creation time is unknown. The format of this field is a Unix nanoseconds time encoded as an int64. On Unix, the command `date +%s%N` returns the current time in nanoseconds since 1970-01-01 00:00:00 UTC. - format: int64 - type: integer - error: - description: error is the last observed error during snapshot creation, if any. Upon success after retry, this error field will be cleared. - properties: - message: - description: "message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information." - type: string - time: - description: time is the timestamp when the error was encountered. - format: date-time - type: string - type: object - readyToUse: - description: readyToUse indicates if a snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown. - type: boolean - restoreSize: - description: restoreSize represents the complete size of the snapshot in bytes. In dynamic snapshot creation case, this field will be filled in by the CSI snapshotter sidecar with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown. - format: int64 - minimum: 0 - type: integer - snapshotHandle: - description: snapshotHandle is the CSI "snapshot_id" of a snapshot on the underlying storage system. If not specified, it indicates that dynamic snapshot creation has either failed or it is still in progress. - type: string - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] - ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.4.0 - api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/419" - creationTimestamp: null - name: volumesnapshots.snapshot.storage.k8s.io -spec: - group: snapshot.storage.k8s.io - names: - kind: VolumeSnapshot - listKind: VolumeSnapshotList - plural: volumesnapshots - singular: volumesnapshot - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: Indicates if the snapshot is ready to be used to restore a volume. - jsonPath: .status.readyToUse - name: ReadyToUse - type: boolean - - description: If a new snapshot needs to be created, this contains the name of the source PVC from which this snapshot was (or will be) created. - jsonPath: .spec.source.persistentVolumeClaimName - name: SourcePVC - type: string - - description: If a snapshot already exists, this contains the name of the existing VolumeSnapshotContent object representing the existing snapshot. - jsonPath: .spec.source.volumeSnapshotContentName - name: SourceSnapshotContent - type: string - - description: Represents the minimum size of volume required to rehydrate from this snapshot. - jsonPath: .status.restoreSize - name: RestoreSize - type: string - - description: The name of the VolumeSnapshotClass requested by the VolumeSnapshot. - jsonPath: .spec.volumeSnapshotClassName - name: SnapshotClass - type: string - - description: Name of the VolumeSnapshotContent object to which the VolumeSnapshot object intends to bind to. Please note that verification of binding actually requires checking both VolumeSnapshot and VolumeSnapshotContent to ensure both are pointing at each other. Binding MUST be verified prior to usage of this object. - jsonPath: .status.boundVolumeSnapshotContentName - name: SnapshotContent - type: string - - description: Timestamp when the point-in-time snapshot was taken by the underlying storage system. - jsonPath: .status.creationTime - name: CreationTime - type: date - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1 - schema: - openAPIV3Schema: - description: VolumeSnapshot is a user's request for either creating a point-in-time snapshot of a persistent volume, or binding to a pre-existing snapshot. - properties: - apiVersion: - description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - kind: - description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - spec: - description: "spec defines the desired characteristics of a snapshot requested by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots Required." - properties: - source: - description: source specifies where a snapshot will be created from. This field is immutable after creation. Required. - properties: - persistentVolumeClaimName: - description: persistentVolumeClaimName specifies the name of the PersistentVolumeClaim object representing the volume from which a snapshot should be created. This PVC is assumed to be in the same namespace as the VolumeSnapshot object. This field should be set if the snapshot does not exists, and needs to be created. This field is immutable. - type: string - volumeSnapshotContentName: - description: volumeSnapshotContentName specifies the name of a pre-existing VolumeSnapshotContent object representing an existing volume snapshot. This field should be set if the snapshot already exists and only needs a representation in Kubernetes. This field is immutable. - type: string - type: object - oneOf: - - required: ["persistentVolumeClaimName"] - - required: ["volumeSnapshotContentName"] - volumeSnapshotClassName: - description: "VolumeSnapshotClassName is the name of the VolumeSnapshotClass requested by the VolumeSnapshot. VolumeSnapshotClassName may be left nil to indicate that the default SnapshotClass should be used. A given cluster may have multiple default Volume SnapshotClasses: one default per CSI Driver. If a VolumeSnapshot does not specify a SnapshotClass, VolumeSnapshotSource will be checked to figure out what the associated CSI Driver is, and the default VolumeSnapshotClass associated with that CSI Driver will be used. If more than one VolumeSnapshotClass exist for a given CSI Driver and more than one have been marked as default, CreateSnapshot will fail and generate an event. Empty string is not allowed for this field." - type: string - required: - - source - type: object - status: - description: status represents the current information of a snapshot. Consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object. - properties: - boundVolumeSnapshotContentName: - description: "boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent object to which this VolumeSnapshot object intends to bind to. If not specified, it indicates that the VolumeSnapshot object has not been successfully bound to a VolumeSnapshotContent object yet. NOTE: To avoid possible security issues, consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object." - type: string - creationTime: - description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it may indicate that the creation time of the snapshot is unknown. - format: date-time - type: string - error: - description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurrs during the snapshot creation. Upon success, this error field will be cleared. - properties: - message: - description: "message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information." - type: string - time: - description: time is the timestamp when the error was encountered. - format: date-time - type: string - type: object - readyToUse: - description: readyToUse indicates if the snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown. - type: boolean - restoreSize: - type: string - description: restoreSize represents the minimum size of volume required to create a volume from this snapshot. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown. - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - required: - - spec - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - description: Indicates if the snapshot is ready to be used to restore a volume. - jsonPath: .status.readyToUse - name: ReadyToUse - type: boolean - - description: If a new snapshot needs to be created, this contains the name of the source PVC from which this snapshot was (or will be) created. - jsonPath: .spec.source.persistentVolumeClaimName - name: SourcePVC - type: string - - description: If a snapshot already exists, this contains the name of the existing VolumeSnapshotContent object representing the existing snapshot. - jsonPath: .spec.source.volumeSnapshotContentName - name: SourceSnapshotContent - type: string - - description: Represents the minimum size of volume required to rehydrate from this snapshot. - jsonPath: .status.restoreSize - name: RestoreSize - type: string - - description: The name of the VolumeSnapshotClass requested by the VolumeSnapshot. - jsonPath: .spec.volumeSnapshotClassName - name: SnapshotClass - type: string - - description: Name of the VolumeSnapshotContent object to which the VolumeSnapshot object intends to bind to. Please note that verification of binding actually requires checking both VolumeSnapshot and VolumeSnapshotContent to ensure both are pointing at each other. Binding MUST be verified prior to usage of this object. - jsonPath: .status.boundVolumeSnapshotContentName - name: SnapshotContent - type: string - - description: Timestamp when the point-in-time snapshot was taken by the underlying storage system. - jsonPath: .status.creationTime - name: CreationTime - type: date - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: VolumeSnapshot is a user's request for either creating a point-in-time snapshot of a persistent volume, or binding to a pre-existing snapshot. - properties: - apiVersion: - description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - type: string - kind: - description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - type: string - spec: - description: "spec defines the desired characteristics of a snapshot requested by a user. More info: https://kubernetes.io/docs/concepts/storage/volume-snapshots#volumesnapshots Required." - properties: - source: - description: source specifies where a snapshot will be created from. This field is immutable after creation. Required. - properties: - persistentVolumeClaimName: - description: persistentVolumeClaimName specifies the name of the PersistentVolumeClaim object representing the volume from which a snapshot should be created. This PVC is assumed to be in the same namespace as the VolumeSnapshot object. This field should be set if the snapshot does not exists, and needs to be created. This field is immutable. - type: string - volumeSnapshotContentName: - description: volumeSnapshotContentName specifies the name of a pre-existing VolumeSnapshotContent object representing an existing volume snapshot. This field should be set if the snapshot already exists and only needs a representation in Kubernetes. This field is immutable. - type: string - type: object - volumeSnapshotClassName: - description: "VolumeSnapshotClassName is the name of the VolumeSnapshotClass requested by the VolumeSnapshot. VolumeSnapshotClassName may be left nil to indicate that the default SnapshotClass should be used. A given cluster may have multiple default Volume SnapshotClasses: one default per CSI Driver. If a VolumeSnapshot does not specify a SnapshotClass, VolumeSnapshotSource will be checked to figure out what the associated CSI Driver is, and the default VolumeSnapshotClass associated with that CSI Driver will be used. If more than one VolumeSnapshotClass exist for a given CSI Driver and more than one have been marked as default, CreateSnapshot will fail and generate an event. Empty string is not allowed for this field." - type: string - required: - - source - type: object - status: - description: status represents the current information of a snapshot. Consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object. - properties: - boundVolumeSnapshotContentName: - description: "boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent object to which this VolumeSnapshot object intends to bind to. If not specified, it indicates that the VolumeSnapshot object has not been successfully bound to a VolumeSnapshotContent object yet. NOTE: To avoid possible security issues, consumers must verify binding between VolumeSnapshot and VolumeSnapshotContent objects is successful (by validating that both VolumeSnapshot and VolumeSnapshotContent point at each other) before using this object." - type: string - creationTime: - description: creationTime is the timestamp when the point-in-time snapshot is taken by the underlying storage system. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "creation_time" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "creation_time" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. If not specified, it may indicate that the creation time of the snapshot is unknown. - format: date-time - type: string - error: - description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurrs during the snapshot creation. Upon success, this error field will be cleared. - properties: - message: - description: "message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information." - type: string - time: - description: time is the timestamp when the error was encountered. - format: date-time - type: string - type: object - readyToUse: - description: readyToUse indicates if the snapshot is ready to be used to restore a volume. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "ready_to_use" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "ready_to_use" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it, otherwise, this field will be set to "True". If not specified, it means the readiness of a snapshot is unknown. - type: boolean - restoreSize: - type: string - description: restoreSize represents the minimum size of volume required to create a volume from this snapshot. In dynamic snapshot creation case, this field will be filled in by the snapshot controller with the "size_bytes" value returned from CSI "CreateSnapshot" gRPC call. For a pre-existing snapshot, this field will be filled with the "size_bytes" value returned from the CSI "ListSnapshots" gRPC call if the driver supports it. When restoring a volume from this snapshot, the size of the volume MUST NOT be smaller than the restoreSize if it is specified, otherwise the restoration will fail. If not specified, it indicates that the size is unknown. - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/charts/aws-ebs-csi-driver/templates/clusterrole-snapshot-controller.yaml b/charts/aws-ebs-csi-driver/templates/clusterrole-snapshot-controller.yaml deleted file mode 100644 index b5b7978831..0000000000 --- a/charts/aws-ebs-csi-driver/templates/clusterrole-snapshot-controller.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: ebs-snapshot-controller-role - labels: - {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} -rules: - - apiGroups: [ "" ] - resources: [ "persistentvolumes" ] - verbs: [ "get", "list", "watch" ] - - apiGroups: [ "" ] - resources: [ "persistentvolumeclaims" ] - verbs: [ "get", "list", "watch", "update" ] - - apiGroups: [ "storage.k8s.io" ] - resources: [ "storageclasses" ] - verbs: [ "get", "list", "watch" ] - - apiGroups: [ "" ] - resources: [ "events" ] - verbs: [ "list", "watch", "create", "update", "patch" ] - - apiGroups: [ "snapshot.storage.k8s.io" ] - resources: [ "volumesnapshotclasses" ] - verbs: [ "get", "list", "watch" ] - - apiGroups: [ "snapshot.storage.k8s.io" ] - resources: [ "volumesnapshotcontents" ] - verbs: [ "create", "get", "list", "watch", "update", "delete" ] - - apiGroups: [ "snapshot.storage.k8s.io" ] - resources: [ "volumesnapshots" ] - verbs: [ "get", "list", "watch", "update" ] - - apiGroups: [ "snapshot.storage.k8s.io" ] - resources: [ "volumesnapshots/status" ] - verbs: [ "update" ] diff --git a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-snapshot-controller.yaml b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-snapshot-controller.yaml deleted file mode 100644 index 55a634fb22..0000000000 --- a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-snapshot-controller.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: ebs-csi-snapshot-controller-binding - labels: - {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} -subjects: - - kind: ServiceAccount - name: {{ .Values.serviceAccount.snapshot.name }} - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: ebs-snapshot-controller-role - apiGroup: rbac.authorization.k8s.io diff --git a/charts/aws-ebs-csi-driver/templates/crds.yml b/charts/aws-ebs-csi-driver/templates/crds.yml deleted file mode 100644 index ebd5f49e6a..0000000000 --- a/charts/aws-ebs-csi-driver/templates/crds.yml +++ /dev/null @@ -1,6 +0,0 @@ -{{- if and .Values.enableVolumeSnapshot (ne (.Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1") true) }} -{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }} -{{ $.Files.Get $path }} ---- -{{- end }} -{{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/poddisruptionbudget-snapshot-controller.yaml b/charts/aws-ebs-csi-driver/templates/poddisruptionbudget-snapshot-controller.yaml deleted file mode 100644 index d9383bcb60..0000000000 --- a/charts/aws-ebs-csi-driver/templates/poddisruptionbudget-snapshot-controller.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- if .Values.enableVolumeSnapshot }} -apiVersion: policy/v1beta1 -kind: PodDisruptionBudget -metadata: - name: ebs-snapshot-controller - labels: - {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} -spec: - selector: - matchLabels: - app: ebs-snapshot-controller - {{- include "aws-ebs-csi-driver.selectorLabels" . | nindent 6 }} - maxUnavailable: 1 -{{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/role-snapshot-controller-leaderelection.yaml b/charts/aws-ebs-csi-driver/templates/role-snapshot-controller-leaderelection.yaml deleted file mode 100644 index 2b55a16ad8..0000000000 --- a/charts/aws-ebs-csi-driver/templates/role-snapshot-controller-leaderelection.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: ebs-snapshot-controller-leaderelection - labels: - {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} -rules: - - apiGroups: [ "coordination.k8s.io" ] - resources: [ "leases" ] - verbs: [ "get", "watch", "list", "delete", "update", "create" ] diff --git a/charts/aws-ebs-csi-driver/templates/rolebinding-snapshot-controller-leaderelection.yaml b/charts/aws-ebs-csi-driver/templates/rolebinding-snapshot-controller-leaderelection.yaml deleted file mode 100644 index 74095f382c..0000000000 --- a/charts/aws-ebs-csi-driver/templates/rolebinding-snapshot-controller-leaderelection.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: ebs-snapshot-controller-leaderelection - labels: - {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} -subjects: - - kind: ServiceAccount - name: {{ .Values.serviceAccount.snapshot.name }} - namespace: {{ .Release.Namespace }} -roleRef: - kind: Role - name: ebs-snapshot-controller-leaderelection - apiGroup: rbac.authorization.k8s.io diff --git a/charts/aws-ebs-csi-driver/templates/serviceaccount-snapshot-controller.yaml b/charts/aws-ebs-csi-driver/templates/serviceaccount-snapshot-controller.yaml deleted file mode 100644 index 9d2c68114b..0000000000 --- a/charts/aws-ebs-csi-driver/templates/serviceaccount-snapshot-controller.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.serviceAccount.snapshot.create }} ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ .Values.serviceAccount.snapshot.name }} - labels: - {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.snapshot.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml b/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml deleted file mode 100644 index bc078f6dd3..0000000000 --- a/charts/aws-ebs-csi-driver/templates/snapshot-controller.yaml +++ /dev/null @@ -1,68 +0,0 @@ -{{- if .Values.enableVolumeSnapshot }} -#Snapshot controller -kind: StatefulSet -apiVersion: apps/v1 -metadata: - name: ebs-snapshot-controller - labels: - {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} -spec: - serviceName: ebs-snapshot-controller - replicas: 1 - selector: - matchLabels: - app: ebs-snapshot-controller - {{- include "aws-ebs-csi-driver.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - app: ebs-snapshot-controller - {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }} - {{- if .Values.snapshotController.podLabels }} - {{- toYaml .Values.snapshotController.podLabels | nindent 8 }} - {{- end }} - {{- if .Values.snapshotController.podAnnotations }} - annotations: {{ toYaml .Values.snapshotController.podAnnotations | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ .Values.serviceAccount.snapshot.name }} - nodeSelector: - kubernetes.io/os: linux - {{- with .Values.nodeSelector }} - {{- toYaml . | nindent 8 }} - {{- end }} - priorityClassName: {{ .Values.priorityClassName | default "system-cluster-critical" }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - tolerations: - - key: CriticalAddonsOnly - operator: Exists - - operator: Exists - effect: NoExecute - tolerationSeconds: 300 - {{- with .Values.tolerations }} - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: snapshot-controller - image: {{ printf "%s:%s" .Values.snapshotController.repository .Values.snapshotController.tag }} - {{- with .Values.resources }} - resources: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- if .Values.proxy.http_proxy }} - env: - {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} - {{- end }} - args: - - --v=5 - - --leader-election=false - {{- if .Values.imagePullSecrets }} - imagePullSecrets: - {{- range .Values.imagePullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 9dbf2daa23..cedd4976da 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -27,12 +27,6 @@ sidecars: repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar tag: "v2.1.0" -snapshotController: - repository: k8s.gcr.io/sig-storage/snapshot-controller - tag: "v3.0.3" - podAnnotations: {} - podLabels: {} - proxy: http_proxy: no_proxy: @@ -138,10 +132,6 @@ serviceAccount: create: true # A service account will be created for you if set to true. Set to false if you want to use your own. name: ebs-csi-controller-sa # Name of the service-account to be used/created. annotations: {} - snapshot: - create: true - name: ebs-snapshot-controller - annotations: {} node: create: true name: ebs-csi-node-sa diff --git a/deploy/kubernetes/base/clusterrole-snapshot-controller.yaml b/deploy/kubernetes/base/clusterrole-snapshot-controller.yaml deleted file mode 100644 index cff0fe0077..0000000000 --- a/deploy/kubernetes/base/clusterrole-snapshot-controller.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# Source: aws-ebs-csi-driver/templates/clusterrole-snapshot-controller.yaml -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: ebs-snapshot-controller-role - labels: - app.kubernetes.io/name: aws-ebs-csi-driver -rules: - - apiGroups: [ "" ] - resources: [ "persistentvolumes" ] - verbs: [ "get", "list", "watch" ] - - apiGroups: [ "" ] - resources: [ "persistentvolumeclaims" ] - verbs: [ "get", "list", "watch", "update" ] - - apiGroups: [ "storage.k8s.io" ] - resources: [ "storageclasses" ] - verbs: [ "get", "list", "watch" ] - - apiGroups: [ "" ] - resources: [ "events" ] - verbs: [ "list", "watch", "create", "update", "patch" ] - - apiGroups: [ "snapshot.storage.k8s.io" ] - resources: [ "volumesnapshotclasses" ] - verbs: [ "get", "list", "watch" ] - - apiGroups: [ "snapshot.storage.k8s.io" ] - resources: [ "volumesnapshotcontents" ] - verbs: [ "create", "get", "list", "watch", "update", "delete" ] - - apiGroups: [ "snapshot.storage.k8s.io" ] - resources: [ "volumesnapshots" ] - verbs: [ "get", "list", "watch", "update" ] - - apiGroups: [ "snapshot.storage.k8s.io" ] - resources: [ "volumesnapshots/status" ] - verbs: [ "update" ] diff --git a/deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml b/deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml deleted file mode 100644 index 6d7cbec1b3..0000000000 --- a/deploy/kubernetes/base/clusterrolebinding-snapshot-controller.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# Source: aws-ebs-csi-driver/templates/clusterrolebinding-snapshot-controller.yaml -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: ebs-csi-snapshot-controller-binding - labels: - app.kubernetes.io/name: aws-ebs-csi-driver -subjects: - - kind: ServiceAccount - name: ebs-snapshot-controller - namespace: default -roleRef: - kind: ClusterRole - name: ebs-snapshot-controller-role - apiGroup: rbac.authorization.k8s.io diff --git a/deploy/kubernetes/base/kustomization.yaml b/deploy/kubernetes/base/kustomization.yaml index 341262e4d8..bcc4f03832 100644 --- a/deploy/kubernetes/base/kustomization.yaml +++ b/deploy/kubernetes/base/kustomization.yaml @@ -5,21 +5,14 @@ resources: - clusterrole-attacher.yaml - clusterrole-provisioner.yaml - clusterrole-resizer.yaml -- clusterrole-snapshot-controller.yaml - clusterrole-snapshotter.yaml - clusterrolebinding-attacher.yaml - clusterrolebinding-provisioner.yaml - clusterrolebinding-resizer.yaml -- clusterrolebinding-snapshot-controller.yaml - clusterrolebinding-snapshotter.yaml - controller.yaml - csidriver.yaml - node.yaml - poddisruptionbudget-controller.yaml -- poddisruptionbudget-snapshot-controller.yaml -- role-snapshot-controller-leaderelection.yaml -- rolebinding-snapshot-controller-leaderelection.yaml - serviceaccount-csi-controller.yaml - serviceaccount-csi-node.yaml -- serviceaccount-snapshot-controller.yaml -- snapshot_controller.yaml diff --git a/deploy/kubernetes/base/poddisruptionbudget-snapshot-controller.yaml b/deploy/kubernetes/base/poddisruptionbudget-snapshot-controller.yaml deleted file mode 100644 index cee8749077..0000000000 --- a/deploy/kubernetes/base/poddisruptionbudget-snapshot-controller.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# Source: aws-ebs-csi-driver/templates/poddisruptionbudget-snapshot-controller.yaml -apiVersion: policy/v1beta1 -kind: PodDisruptionBudget -metadata: - name: ebs-snapshot-controller - labels: - app.kubernetes.io/name: aws-ebs-csi-driver -spec: - selector: - matchLabels: - app: ebs-snapshot-controller - app.kubernetes.io/name: aws-ebs-csi-driver - maxUnavailable: 1 diff --git a/deploy/kubernetes/base/role-snapshot-controller-leaderelection.yaml b/deploy/kubernetes/base/role-snapshot-controller-leaderelection.yaml deleted file mode 100644 index 3ee9f032ec..0000000000 --- a/deploy/kubernetes/base/role-snapshot-controller-leaderelection.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# Source: aws-ebs-csi-driver/templates/role-snapshot-controller-leaderelection.yaml -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: ebs-snapshot-controller-leaderelection - labels: - app.kubernetes.io/name: aws-ebs-csi-driver -rules: - - apiGroups: [ "coordination.k8s.io" ] - resources: [ "leases" ] - verbs: [ "get", "watch", "list", "delete", "update", "create" ] diff --git a/deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml b/deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml deleted file mode 100644 index fd9ab78b4b..0000000000 --- a/deploy/kubernetes/base/rolebinding-snapshot-controller-leaderelection.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# Source: aws-ebs-csi-driver/templates/rolebinding-snapshot-controller-leaderelection.yaml -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: ebs-snapshot-controller-leaderelection - labels: - app.kubernetes.io/name: aws-ebs-csi-driver -subjects: - - kind: ServiceAccount - name: ebs-snapshot-controller - namespace: default -roleRef: - kind: Role - name: ebs-snapshot-controller-leaderelection - apiGroup: rbac.authorization.k8s.io diff --git a/deploy/kubernetes/base/serviceaccount-snapshot-controller.yaml b/deploy/kubernetes/base/serviceaccount-snapshot-controller.yaml deleted file mode 100644 index 38ce91b2db..0000000000 --- a/deploy/kubernetes/base/serviceaccount-snapshot-controller.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Source: aws-ebs-csi-driver/templates/serviceaccount-snapshot-controller.yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: ebs-snapshot-controller - labels: - app.kubernetes.io/name: aws-ebs-csi-driver diff --git a/deploy/kubernetes/base/snapshot_controller.yaml b/deploy/kubernetes/base/snapshot_controller.yaml deleted file mode 100644 index 32af1e8845..0000000000 --- a/deploy/kubernetes/base/snapshot_controller.yaml +++ /dev/null @@ -1,38 +0,0 @@ ---- -# Source: aws-ebs-csi-driver/templates/snapshot-controller.yaml -#Snapshot controller -kind: StatefulSet -apiVersion: apps/v1 -metadata: - name: ebs-snapshot-controller - labels: - app.kubernetes.io/name: aws-ebs-csi-driver -spec: - serviceName: ebs-snapshot-controller - replicas: 1 - selector: - matchLabels: - app: ebs-snapshot-controller - app.kubernetes.io/name: aws-ebs-csi-driver - template: - metadata: - labels: - app: ebs-snapshot-controller - app.kubernetes.io/name: aws-ebs-csi-driver - spec: - serviceAccountName: ebs-snapshot-controller - nodeSelector: - kubernetes.io/os: linux - priorityClassName: system-cluster-critical - tolerations: - - key: CriticalAddonsOnly - operator: Exists - - operator: Exists - effect: NoExecute - tolerationSeconds: 300 - containers: - - name: snapshot-controller - image: k8s.gcr.io/sig-storage/snapshot-controller:v3.0.3 - args: - - --v=5 - - --leader-election=false diff --git a/docs/README.md b/docs/README.md index 85fc235920..84faffd622 100644 --- a/docs/README.md +++ b/docs/README.md @@ -127,6 +127,7 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll * Enable flag `--allow-privileged=true` for `kubelet` and `kube-apiserver` * Enable `kube-apiserver` feature gates `--feature-gates=CSINodeInfo=true,CSIDriverRegistry=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true` * Enable `kubelet` feature gates `--feature-gates=CSINodeInfo=true,CSIDriverRegistry=true,CSIBlockVolume=true` +* If you intend to use the csi-snapshotter functionality you will need to first install the [CSI Snapshotter](https://github.com/kubernetes-csi/external-snapshotter) ## Installation #### Set up driver permission From 5bdc10354cc04ef45a0f6528554264feee0dbcc2 Mon Sep 17 00:00:00 2001 From: Kyle Michel Date: Mon, 5 Jul 2021 18:01:09 -0400 Subject: [PATCH 46/59] Allow non-string values for extra volume tags --- charts/aws-ebs-csi-driver/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/aws-ebs-csi-driver/templates/_helpers.tpl b/charts/aws-ebs-csi-driver/templates/_helpers.tpl index c334bd5d0d..424f7ea150 100644 --- a/charts/aws-ebs-csi-driver/templates/_helpers.tpl +++ b/charts/aws-ebs-csi-driver/templates/_helpers.tpl @@ -61,7 +61,7 @@ Convert the `--extra-volume-tags` command line arg from a map. {{- define "aws-ebs-csi-driver.extra-volume-tags" -}} {{- $result := dict "pairs" (list) -}} {{- range $key, $value := .Values.controller.extraVolumeTags -}} -{{- $noop := printf "%s=%s" $key $value | append $result.pairs | set $result "pairs" -}} +{{- $noop := printf "%s=%v" $key $value | append $result.pairs | set $result "pairs" -}} {{- end -}} {{- if gt (len $result.pairs) 0 -}} {{- printf "%s=%s" "- --extra-volume-tags" (join "," $result.pairs) -}} From 6e2b237ec103c577f2d21862be828ea25882f573 Mon Sep 17 00:00:00 2001 From: Kyle Michel Date: Tue, 6 Jul 2021 22:19:10 -0400 Subject: [PATCH 47/59] Add documentation about breaking changes Remove enableVolumeSnapshot value Try to fix tests --- Makefile | 2 +- charts/aws-ebs-csi-driver/templates/NOTES.txt | 2 ++ .../templates/controller.yaml | 4 ++-- charts/aws-ebs-csi-driver/values.yaml | 3 --- deploy/kubernetes/values/snapshotter.yaml | 1 - docs/README.md | 20 +++++++++++++++++++ hack/values_eksctl.yaml | 1 - 7 files changed, 25 insertions(+), 8 deletions(-) delete mode 100644 deploy/kubernetes/values/snapshotter.yaml diff --git a/Makefile b/Makefile index 4c0ebaa036..62be0af953 100644 --- a/Makefile +++ b/Makefile @@ -155,7 +155,7 @@ generate-kustomize: bin/helm cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-provisioner.yaml > ../../deploy/kubernetes/base/clusterrolebinding-provisioner.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-resizer.yaml > ../../deploy/kubernetes/base/clusterrolebinding-resizer.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/clusterrolebinding-snapshotter.yaml > ../../deploy/kubernetes/base/clusterrolebinding-snapshotter.yaml - cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/controller.yaml --set enableVolumeSnapshot=true > ../../deploy/kubernetes/base/controller.yaml + cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/controller.yaml --api-versions 'snapshot.storage.k8s.io/v1' > ../../deploy/kubernetes/base/controller.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/csidriver.yaml > ../../deploy/kubernetes/base/csidriver.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/node.yaml > ../../deploy/kubernetes/base/node.yaml cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/poddisruptionbudget-controller.yaml > ../../deploy/kubernetes/base/poddisruptionbudget-controller.yaml diff --git a/charts/aws-ebs-csi-driver/templates/NOTES.txt b/charts/aws-ebs-csi-driver/templates/NOTES.txt index 3717647d78..5d79084ec7 100644 --- a/charts/aws-ebs-csi-driver/templates/NOTES.txt +++ b/charts/aws-ebs-csi-driver/templates/NOTES.txt @@ -1,3 +1,5 @@ To verify that aws-ebs-csi-driver has started, run: kubectl get pod -n {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "aws-ebs-csi-driver.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" + +NOTE: The [CSI Snapshotter](https://github.com/kubernetes-csi/external-snapshotter) controller and CRDs will no longer be installed as part of this chart and moving forward will be a prerequisite of using the snap shotting functionality. \ No newline at end of file diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index fd98d344f1..6b563a6128 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -189,7 +189,7 @@ spec: resources: {{- toYaml . | nindent 12 }} {{- end }} -{{- if or .Values.enableVolumeSnapshot (.Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1") }} + {{- if .Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1" }} - name: csi-snapshotter image: {{ printf "%s:%s" .Values.sidecars.snapshotterImage.repository .Values.sidecars.snapshotterImage.tag }} args: @@ -211,7 +211,7 @@ spec: resources: {{- toYaml . | nindent 12 }} {{- end }} -{{- end }} + {{- end }} - name: csi-resizer image: {{ printf "%s:%s" .Values.sidecars.resizerImage.repository .Values.sidecars.resizerImage.tag }} imagePullPolicy: Always diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index cedd4976da..7d6bef582b 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -35,9 +35,6 @@ imagePullSecrets: [] nameOverride: fullnameOverride: -# True if enable volume snapshot -enableVolumeSnapshot: false - controller: # If arbitrary args like "--aws-sdk-debug-log=true" need to be passed, use this value additionalArgs: [] diff --git a/deploy/kubernetes/values/snapshotter.yaml b/deploy/kubernetes/values/snapshotter.yaml deleted file mode 100644 index 0ff3e8cc91..0000000000 --- a/deploy/kubernetes/values/snapshotter.yaml +++ /dev/null @@ -1 +0,0 @@ -enableVolumeSnapshot: true \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 84faffd622..d07e366240 100644 --- a/docs/README.md +++ b/docs/README.md @@ -177,6 +177,26 @@ helm upgrade --install aws-ebs-csi-driver \ aws-ebs-csi-driver/aws-ebs-csi-driver ``` +##### Upgrading from version 1.X to 2.X of the helm chart +Version 2.0.0 remove support for helm v2 and now requires helm v3 or above + +The [CSI Snapshotter](https://github.com/kubernetes-csi/external-snapshotter) controller and CRDs will no longer be installed as part of this chart and moving forward will be a prerequisite of using the snap shotting functionality. + +The following deprecated values have been removed, and you should now use their counterparts under the `controller` and `node` maps which have been available since chart version 1.1.0 +* affinity +* extraCreateMetadata +* extraVolumeTags +* k8sTagClusterId +* nodeSelector +* podAnnotations +* priorityClassName +* region +* replicaCount +* resources +* tolerations +* topologySpreadConstraints +* volumeAttachLimit + #### Deploy driver with debug mode To view driver debug logs, run the CSI driver with `-v=5` command line option diff --git a/hack/values_eksctl.yaml b/hack/values_eksctl.yaml index f84eeefad0..b16b6737ac 100644 --- a/hack/values_eksctl.yaml +++ b/hack/values_eksctl.yaml @@ -1,4 +1,3 @@ -enableVolumeSnapshot: true controller: logLevel: 5 node: From 0fbd9f793c2da68abcdce991e045c0d72675e0e8 Mon Sep 17 00:00:00 2001 From: Kyle Michel Date: Thu, 8 Jul 2021 17:59:34 -0400 Subject: [PATCH 48/59] Updates for suggestions from PR --- .../clusterrolebinding-attacher.yaml | 2 +- .../clusterrolebinding-csi-node.yaml | 2 +- .../clusterrolebinding-provisioner.yaml | 2 +- .../templates/clusterrolebinding-resizer.yaml | 2 +- .../clusterrolebinding-snapshotter.yaml | 2 +- .../templates/controller.yaml | 24 +++--- .../templates/node-windows.yaml | 12 +-- charts/aws-ebs-csi-driver/templates/node.yaml | 12 +-- .../serviceaccount-csi-controller.yaml | 6 +- .../templates/serviceaccount-csi-node.yaml | 6 +- charts/aws-ebs-csi-driver/values.yaml | 75 +++++++++---------- docs/README.md | 49 +++++++++++- hack/values_eksctl.yaml | 5 +- 13 files changed, 122 insertions(+), 77 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-attacher.yaml b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-attacher.yaml index c75cb9b1d2..bb23044b20 100644 --- a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-attacher.yaml +++ b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-attacher.yaml @@ -7,7 +7,7 @@ metadata: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} subjects: - kind: ServiceAccount - name: {{ .Values.serviceAccount.controller.name }} + name: {{ .Values.controller.serviceAccount.name }} namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole diff --git a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-csi-node.yaml b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-csi-node.yaml index 63d843e529..55231356e5 100644 --- a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-csi-node.yaml +++ b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-csi-node.yaml @@ -7,7 +7,7 @@ metadata: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} subjects: - kind: ServiceAccount - name: {{ .Values.serviceAccount.node.name }} + name: {{ .Values.node.serviceAccount.name }} namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole diff --git a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-provisioner.yaml b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-provisioner.yaml index 4a9174b7e1..9d2749ac3a 100644 --- a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-provisioner.yaml +++ b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-provisioner.yaml @@ -7,7 +7,7 @@ metadata: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} subjects: - kind: ServiceAccount - name: {{ .Values.serviceAccount.controller.name }} + name: {{ .Values.controller.serviceAccount.name }} namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole diff --git a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-resizer.yaml b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-resizer.yaml index 768e589137..88cb47de11 100644 --- a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-resizer.yaml +++ b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-resizer.yaml @@ -7,7 +7,7 @@ metadata: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} subjects: - kind: ServiceAccount - name: {{ .Values.serviceAccount.controller.name }} + name: {{ .Values.controller.serviceAccount.name }} namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole diff --git a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-snapshotter.yaml b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-snapshotter.yaml index e9f36246ec..2d4290546e 100644 --- a/charts/aws-ebs-csi-driver/templates/clusterrolebinding-snapshotter.yaml +++ b/charts/aws-ebs-csi-driver/templates/clusterrolebinding-snapshotter.yaml @@ -7,7 +7,7 @@ metadata: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} subjects: - kind: ServiceAccount - name: {{ .Values.serviceAccount.controller.name }} + name: {{ .Values.controller.serviceAccount.name }} namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index 6b563a6128..32cdbc3c92 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -29,7 +29,7 @@ spec: {{- with .Values.controller.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ .Values.serviceAccount.controller.name }} + serviceAccountName: {{ .Values.controller.serviceAccount.name }} priorityClassName: {{ .Values.controller.priorityClassName }} {{- with default .Values.controller.affinity }} affinity: @@ -136,12 +136,12 @@ spec: timeoutSeconds: 3 periodSeconds: 10 failureThreshold: 5 - {{- with default .Values.controller.resources .Values.controller.containerResources.ebsPlugin }} + {{- with .Values.controller.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} - name: csi-provisioner - image: {{ printf "%s:%s" .Values.sidecars.provisionerImage.repository .Values.sidecars.provisionerImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.provisioner.image.repository .Values.sidecars.provisioner.image.tag }} args: - --csi-address=$(ADDRESS) - --v=5 @@ -163,12 +163,12 @@ spec: volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- with default .Values.controller.resources .Values.controller.containerResources.provisioner }} + {{- with default .Values.controller.resources .Values.sidecars.provisioner.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} - name: csi-attacher - image: {{ printf "%s:%s" .Values.sidecars.attacherImage.repository .Values.sidecars.attacherImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.attacher.image.repository .Values.sidecars.attacher.image.tag }} args: - --csi-address=$(ADDRESS) - --v=5 @@ -185,13 +185,13 @@ spec: volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- with default .Values.controller.resources .Values.controller.containerResources.attacher }} + {{- with default .Values.controller.resources .Values.sidecars.attacher.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} {{- if .Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1" }} - name: csi-snapshotter - image: {{ printf "%s:%s" .Values.sidecars.snapshotterImage.repository .Values.sidecars.snapshotterImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.snapshotter.image.repository .Values.sidecars.snapshotter.image.tag }} args: - --csi-address=$(ADDRESS) - --leader-election=true @@ -207,13 +207,13 @@ spec: volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- with default .Values.controller.resources .Values.controller.containerResources.snapshotter }} + {{- with default .Values.controller.resources .Values.sidecars.snapshotter.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} {{- end }} - name: csi-resizer - image: {{ printf "%s:%s" .Values.sidecars.resizerImage.repository .Values.sidecars.resizerImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.resizer.image.repository .Values.sidecars.resizer.image.tag }} imagePullPolicy: Always args: - --csi-address=$(ADDRESS) @@ -230,18 +230,18 @@ spec: volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- with default .Values.controller.resources .Values.controller.containerResources.resizer }} + {{- with default .Values.controller.resources .Values.sidecars.resizer.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} - name: liveness-probe - image: {{ printf "%s:%s" .Values.sidecars.livenessProbeImage.repository .Values.sidecars.livenessProbeImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.livenessProbe.image.repository .Values.sidecars.livenessProbe.image.tag }} args: - --csi-address=/csi/csi.sock volumeMounts: - name: socket-dir mountPath: /csi - {{- with default .Values.controller.resources .Values.controller.containerResources.liveness }} + {{- with default .Values.controller.resources .Values.sidecars.livenessProbe.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/node-windows.yaml b/charts/aws-ebs-csi-driver/templates/node-windows.yaml index 9111d45b25..96896b8205 100644 --- a/charts/aws-ebs-csi-driver/templates/node-windows.yaml +++ b/charts/aws-ebs-csi-driver/templates/node-windows.yaml @@ -33,7 +33,7 @@ spec: {{- with .Values.node.nodeSelector }} {{ toYaml . | indent 8 }} {{- end }} - serviceAccountName: {{ .Values.serviceAccount.node.name }} + serviceAccountName: {{ .Values.node.serviceAccount.name }} priorityClassName: {{ .Values.node.priorityClassName | default "system-cluster-critical" }} tolerations: {{- if .Values.node.tolerateAllTaints }} @@ -94,11 +94,11 @@ spec: timeoutSeconds: 3 periodSeconds: 10 failureThreshold: 5 - {{- with default .Values.node.resources .Values.node.containerResources.ebsPlugin }} + {{- with .Values.node.resources }} resources: {{ toYaml . | nindent 12 }} {{- end }} - name: node-driver-registrar - image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrarImage.repository .Values.sidecars.nodeDriverRegistrarImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrar.image.repository .Values.sidecars.nodeDriverRegistrar.image.tag }} args: - --csi-address=$(ADDRESS) - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) @@ -121,17 +121,17 @@ spec: mountPath: C:\csi - name: registration-dir mountPath: C:\registration - {{- with default .Values.node.resources .Values.node.containerResources.nodeDriverRegistrar }} + {{- with default .Values.node.resources .Values.sidecars.nodeDriverRegistrar.resources }} resources: {{ toYaml . | nindent 12 }} {{- end }} - name: liveness-probe - image: {{ printf "%s:%s" .Values.sidecars.livenessProbeImage.repository .Values.sidecars.livenessProbeImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.livenessProbe.image.repository .Values.sidecars.livenessProbe.image.tag }} args: - --csi-address=unix:/csi/csi.sock volumeMounts: - name: plugin-dir mountPath: C:\csi - {{- with default .Values.node.resources .Values.node.containerResources.liveness }} + {{- with default .Values.node.resources .Values.sidecars.livenessProbe.resources }} resources: {{ toYaml . | nindent 12 }} {{- end }} {{- if .Values.imagePullSecrets }} diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index f24ebae101..bdca51b781 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -37,7 +37,7 @@ spec: {{- with .Values.node.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ .Values.serviceAccount.node.name }} + serviceAccountName: {{ .Values.node.serviceAccount.name }} priorityClassName: {{ .Values.node.priorityClassName | default "system-node-critical" }} tolerations: {{- if .Values.node.tolerateAllTaints }} @@ -98,12 +98,12 @@ spec: timeoutSeconds: 3 periodSeconds: 10 failureThreshold: 5 - {{- with default .Values.node.resources .Values.node.containerResources.ebsPlugin }} + {{- with .Values.node.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} - name: node-driver-registrar - image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrarImage.repository .Values.sidecars.nodeDriverRegistrarImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrar.image.repository .Values.sidecars.nodeDriverRegistrar.image.tag }} args: - --csi-address=$(ADDRESS) - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) @@ -124,18 +124,18 @@ spec: mountPath: /csi - name: registration-dir mountPath: /registration - {{- with default .Values.node.resources .Values.node.containerResources.nodeDriverRegistrar }} + {{- with default .Values.node.resources .Values.sidecars.nodeDriverRegistrar.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} - name: liveness-probe - image: {{ printf "%s:%s" .Values.sidecars.livenessProbeImage.repository .Values.sidecars.livenessProbeImage.tag }} + image: {{ printf "%s:%s" .Values.sidecars.livenessProbe.image.repository .Values.sidecars.livenessProbe.image.tag }} args: - --csi-address=/csi/csi.sock volumeMounts: - name: plugin-dir mountPath: /csi - {{- with default .Values.node.resources .Values.node.containerResources.liveness }} + {{- with default .Values.node.resources .Values.sidecars.livenessProbe.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-controller.yaml b/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-controller.yaml index b465c3be25..d6466e86fa 100644 --- a/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-controller.yaml @@ -1,11 +1,11 @@ -{{- if .Values.serviceAccount.controller.create -}} +{{- if .Values.controller.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ .Values.serviceAccount.controller.name }} + name: {{ .Values.controller.serviceAccount.name }} labels: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.controller.annotations }} + {{- with .Values.controller.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml b/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml index 4722b2a95e..907870912e 100644 --- a/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml +++ b/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml @@ -1,11 +1,11 @@ -{{- if .Values.serviceAccount.node.create -}} +{{- if .Values.node.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ .Values.serviceAccount.node.name }} + name: {{ .Values.node.serviceAccount.name }} labels: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.node.annotations }} + {{- with .Values.node.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 7d6bef582b..c312675017 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -8,24 +8,36 @@ image: pullPolicy: IfNotPresent sidecars: - provisionerImage: - repository: k8s.gcr.io/sig-storage/csi-provisioner - tag: "v2.1.1" - attacherImage: - repository: k8s.gcr.io/sig-storage/csi-attacher - tag: "v3.1.0" - snapshotterImage: - repository: k8s.gcr.io/sig-storage/csi-snapshotter - tag: "v3.0.3" - livenessProbeImage: - repository: k8s.gcr.io/sig-storage/livenessprobe - tag: "v2.2.0" - resizerImage: - repository: k8s.gcr.io/sig-storage/csi-resizer - tag: "v1.0.0" - nodeDriverRegistrarImage: - repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar - tag: "v2.1.0" + provisioner: + image: + repository: k8s.gcr.io/sig-storage/csi-provisioner + tag: "v2.1.1" + resources: {} + attacher: + image: + repository: k8s.gcr.io/sig-storage/csi-attacher + tag: "v3.1.0" + resources: {} + snapshotter: + image: + repository: k8s.gcr.io/sig-storage/csi-snapshotter + tag: "v3.0.3" + resources: {} + livenessProbe: + image: + repository: k8s.gcr.io/sig-storage/livenessprobe + tag: "v2.2.0" + resources: {} + resizer: + image: + repository: k8s.gcr.io/sig-storage/csi-resizer + tag: "v1.0.0" + resources: {} + nodeDriverRegistrar: + image: + repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar + tag: "v2.1.0" + resources: {} proxy: http_proxy: @@ -71,13 +83,10 @@ controller: region: replicaCount: 2 resources: {} - containerResources: - ebsPlugin: {} - provisioner: {} - attacher: {} - snapshotter: {} - resizer: {} - liveness: {} + serviceAccount: + create: true # A service account will be created for you if set to true. Set to false if you want to use your own. + name: ebs-csi-controller-sa # Name of the service-account to be used/created. + annotations: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -117,22 +126,12 @@ node: tolerateAllTaints: false tolerations: [] resources: {} - containerResources: - ebsPlugin: {} - nodeDriverRegistrar: {} - liveness: {} - # The "maximum number of attachable volumes" per node - volumeAttachLimit: - -serviceAccount: - controller: - create: true # A service account will be created for you if set to true. Set to false if you want to use your own. - name: ebs-csi-controller-sa # Name of the service-account to be used/created. - annotations: {} - node: + serviceAccount: create: true name: ebs-csi-node-sa annotations: {} + # The "maximum number of attachable volumes" per node + volumeAttachLimit: storageClasses: [] # Add StorageClass resources like: diff --git a/docs/README.md b/docs/README.md index d07e366240..3f3bc27ffb 100644 --- a/docs/README.md +++ b/docs/README.md @@ -133,7 +133,7 @@ Following sections are Kubernetes specific. If you are Kubernetes user, use foll #### Set up driver permission The driver requires IAM permission to talk to Amazon EBS to manage the volume on user's behalf. [The example policy here](./example-iam-policy.json) defines these permissions. There are several methods to grant the driver IAM permission: * Using IAM [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) - attach the policy to the instance profile IAM role and turn on access to [instance metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for the instance(s) on which the driver Deployment will run -* EKS only: Using [IAM roles for ServiceAccounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) - create an IAM role, attach the policy to it, then follow the IRSA documentation to associate the IAM role with the driver Deployment service account, which if you are installing via helm is determined by value `serviceAccount.controller.name`, `ebs-csi-controller-sa` by default +* EKS only: Using [IAM roles for ServiceAccounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) - create an IAM role, attach the policy to it, then follow the IRSA documentation to associate the IAM role with the driver Deployment service account, which if you are installing via helm is determined by value `controller.serviceAccount.name`, `ebs-csi-controller-sa` by default * Using secret object - create an IAM user, attach the policy to it, put that user's credentials in [secret manifest](../deploy/kubernetes/secret.yaml), then deploy the secret ```sh curl https://raw.githubusercontent.com/kubernetes-sigs/aws-ebs-csi-driver/master/deploy/kubernetes/secret.yaml > secret.yaml @@ -197,6 +197,53 @@ The following deprecated values have been removed, and you should now use their * topologySpreadConstraints * volumeAttachLimit +The values under `serviceAccount.controller` have been relocated to `controller.serviceAccount` +The values under `serviceAccount.node` have been relocated to `node.serviceAccount` + +The following `sidecars` values have been reorganized from +```yaml +sidecars: + provisionerImage: + attacherImage: + snapshotterImage: + livenessProbeImage: + resizerImage: + nodeDriverRegistrarImage: +``` +to +```yaml +sidecars: + provisioner: + image: + attacher: + image: + snapshotter: + image: + livenessProbe: + image: + resizer: + image: + nodeDriverRegistrar: + image: +``` + +With the above reorganization `controller.containerResources` and `node.containerResources` were also moved into the sidecars structure as follows +```yaml +sidecars: + provisioner: + resources: {} + attacher: + resources: {} + snapshotter: + resources: {} + livenessProbe: + resources: {} + resizer: + resources: {} + nodeDriverRegistrar: + resources: {} +``` + #### Deploy driver with debug mode To view driver debug logs, run the CSI driver with `-v=5` command line option diff --git a/hack/values_eksctl.yaml b/hack/values_eksctl.yaml index b16b6737ac..5b1e27d562 100644 --- a/hack/values_eksctl.yaml +++ b/hack/values_eksctl.yaml @@ -1,7 +1,6 @@ controller: logLevel: 5 + serviceAccount: + create: false # let eksctl create it node: logLevel: 5 -serviceAccount: - controller: - create: false # let eksctl create it From 127c7f1d8cd6bc614cf6915dc05ff7d2addb97c9 Mon Sep 17 00:00:00 2001 From: Kyle Michel Date: Thu, 8 Jul 2021 21:22:12 -0400 Subject: [PATCH 49/59] Make sidecar log levels configurable --- charts/aws-ebs-csi-driver/templates/controller.yaml | 6 +++--- charts/aws-ebs-csi-driver/templates/node-windows.yaml | 4 ++-- charts/aws-ebs-csi-driver/templates/node.yaml | 2 +- charts/aws-ebs-csi-driver/values.yaml | 5 +++++ deploy/kubernetes/base/controller.yaml | 6 +++--- deploy/kubernetes/base/node.yaml | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index 32cdbc3c92..b24f500b2e 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -144,7 +144,7 @@ spec: image: {{ printf "%s:%s" .Values.sidecars.provisioner.image.repository .Values.sidecars.provisioner.image.tag }} args: - --csi-address=$(ADDRESS) - - --v=5 + - --v={{ .Values.sidecars.provisioner.logLevel }} - --feature-gates=Topology=true {{- if .Values.controller.extraCreateMetadata }} - --extra-create-metadata @@ -171,7 +171,7 @@ spec: image: {{ printf "%s:%s" .Values.sidecars.attacher.image.repository .Values.sidecars.attacher.image.tag }} args: - --csi-address=$(ADDRESS) - - --v=5 + - --v={{ .Values.sidecars.attacher.logLevel }} - --leader-election=true env: - name: ADDRESS @@ -217,7 +217,7 @@ spec: imagePullPolicy: Always args: - --csi-address=$(ADDRESS) - - --v=5 + - --v={{ .Values.sidecars.resizer.logLevel }} env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock diff --git a/charts/aws-ebs-csi-driver/templates/node-windows.yaml b/charts/aws-ebs-csi-driver/templates/node-windows.yaml index 96896b8205..4502e8da73 100644 --- a/charts/aws-ebs-csi-driver/templates/node-windows.yaml +++ b/charts/aws-ebs-csi-driver/templates/node-windows.yaml @@ -58,7 +58,7 @@ spec: - --volume-attach-limit={{ . }} {{- end }} - --logtostderr - - --v=5 + - --v={{ .Values.node.logLevel }} env: - name: CSI_ENDPOINT value: unix:/csi/csi.sock @@ -102,7 +102,7 @@ spec: args: - --csi-address=$(ADDRESS) - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) - - --v=5 + - --v={{ .Values.sidecars.nodeDriverRegistrar.logLevel }} env: - name: ADDRESS value: unix:/csi/csi.sock diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index bdca51b781..b37160644c 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -107,7 +107,7 @@ spec: args: - --csi-address=$(ADDRESS) - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) - - --v=5 + - --v={{ .Values.sidecars.nodeDriverRegistrar.logLevel }} env: - name: ADDRESS value: /csi/csi.sock diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index c312675017..99c48c7625 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -12,16 +12,19 @@ sidecars: image: repository: k8s.gcr.io/sig-storage/csi-provisioner tag: "v2.1.1" + logLevel: 2 resources: {} attacher: image: repository: k8s.gcr.io/sig-storage/csi-attacher tag: "v3.1.0" + logLevel: 2 resources: {} snapshotter: image: repository: k8s.gcr.io/sig-storage/csi-snapshotter tag: "v3.0.3" + logLevel: 2 resources: {} livenessProbe: image: @@ -32,11 +35,13 @@ sidecars: image: repository: k8s.gcr.io/sig-storage/csi-resizer tag: "v1.0.0" + logLevel: 2 resources: {} nodeDriverRegistrar: image: repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar tag: "v2.1.0" + logLevel: 2 resources: {} proxy: diff --git a/deploy/kubernetes/base/controller.yaml b/deploy/kubernetes/base/controller.yaml index a038c16589..e86eaff5a9 100644 --- a/deploy/kubernetes/base/controller.yaml +++ b/deploy/kubernetes/base/controller.yaml @@ -84,7 +84,7 @@ spec: image: k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 args: - --csi-address=$(ADDRESS) - - --v=5 + - --v=2 - --feature-gates=Topology=true - --extra-create-metadata - --leader-election=true @@ -99,7 +99,7 @@ spec: image: k8s.gcr.io/sig-storage/csi-attacher:v3.1.0 args: - --csi-address=$(ADDRESS) - - --v=5 + - --v=2 - --leader-election=true env: - name: ADDRESS @@ -123,7 +123,7 @@ spec: imagePullPolicy: Always args: - --csi-address=$(ADDRESS) - - --v=5 + - --v=2 env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock diff --git a/deploy/kubernetes/base/node.yaml b/deploy/kubernetes/base/node.yaml index d48a55f93c..0df6f6f7f2 100644 --- a/deploy/kubernetes/base/node.yaml +++ b/deploy/kubernetes/base/node.yaml @@ -79,7 +79,7 @@ spec: args: - --csi-address=$(ADDRESS) - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) - - --v=5 + - --v=2 env: - name: ADDRESS value: /csi/csi.sock From 528a23b5f9c91b6ccf3809db283cb7f3513b18a2 Mon Sep 17 00:00:00 2001 From: Kyle Michel Date: Fri, 9 Jul 2021 21:28:31 -0400 Subject: [PATCH 50/59] Update chart changelog --- charts/aws-ebs-csi-driver/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/aws-ebs-csi-driver/CHANGELOG.md b/charts/aws-ebs-csi-driver/CHANGELOG.md index b82cf8631f..8f9b60d965 100644 --- a/charts/aws-ebs-csi-driver/CHANGELOG.md +++ b/charts/aws-ebs-csi-driver/CHANGELOG.md @@ -1,5 +1,13 @@ # Helm chart +# v2.0.0 +* Remove support for Helm 2 +* Remove deprecated values +* No longer install snapshot controller or its CRDs +* Reorganize additional values + +[Upgrade instructions](/docs/README.md#upgrading-from-version-1x-to-2x-of-the-helm-chart) + # v1.2.4 * Bump app/driver version to `v1.1.1` * Install VolumeSnapshotClass, VolumeSnapshotContent, VolumeSnapshot CRDs if enableVolumeSnapshot is true From 28e7878e1772d180c550610946336d3f921bd240 Mon Sep 17 00:00:00 2001 From: Kyle Michel Date: Mon, 12 Jul 2021 22:04:08 -0400 Subject: [PATCH 51/59] Reorganize extra environment variable values --- .../templates/controller.yaml | 16 ++++------- charts/aws-ebs-csi-driver/templates/node.yaml | 4 +-- charts/aws-ebs-csi-driver/values.yaml | 27 ++++++++----------- docs/README.md | 7 ++++- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/controller.yaml b/charts/aws-ebs-csi-driver/templates/controller.yaml index b24f500b2e..e0dfcc8a75 100644 --- a/charts/aws-ebs-csi-driver/templates/controller.yaml +++ b/charts/aws-ebs-csi-driver/templates/controller.yaml @@ -101,16 +101,10 @@ spec: - name: AWS_REGION value: {{ . }} {{- end }} - {{- if .Values.controller.extraVars }} - {{- range $key, $val := .Values.controller.extraVars }} - - name: {{ $key }} - value: "{{ $val }}" - {{- end }} - {{- end }} {{- if .Values.proxy.http_proxy }} {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} {{- end }} - {{- with .Values.controller.env.ebsPlugin }} + {{- with .Values.controller.env }} {{- . | toYaml | nindent 12 }} {{- end }} volumeMounts: @@ -157,7 +151,7 @@ spec: {{- if .Values.proxy.http_proxy }} {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} {{- end }} - {{- with .Values.controller.env.provisioner }} + {{- with .Values.sidecars.provisioner.env }} {{- . | toYaml | nindent 12 }} {{- end }} volumeMounts: @@ -179,7 +173,7 @@ spec: {{- if .Values.proxy.http_proxy }} {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} {{- end }} - {{- with .Values.controller.env.attacher }} + {{- with .Values.sidecars.attacher.env }} {{- . | toYaml | nindent 12 }} {{- end }} volumeMounts: @@ -201,7 +195,7 @@ spec: {{- if .Values.proxy.http_proxy }} {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} {{- end }} - {{- with .Values.controller.env.snapshotter }} + {{- with .Values.sidecars.snapshotter.env }} {{- . | toYaml | nindent 12 }} {{- end }} volumeMounts: @@ -224,7 +218,7 @@ spec: {{- if .Values.proxy.http_proxy }} {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} {{- end }} - {{- with .Values.controller.env.resizer }} + {{- with .Values.sidecars.resizer.env }} {{- . | toYaml | nindent 12 }} {{- end }} volumeMounts: diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index b37160644c..de771a888f 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -75,7 +75,7 @@ spec: {{- if .Values.proxy.http_proxy }} {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} {{- end }} - {{- with .Values.node.env.ebsPlugin }} + {{- with .Values.node.env }} {{- . | toYaml | nindent 12 }} {{- end }} volumeMounts: @@ -116,7 +116,7 @@ spec: {{- if .Values.proxy.http_proxy }} {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} {{- end }} - {{- with .Values.node.env.nodeDriverRegistrar }} + {{- with .Values.sidecars.nodeDriverRegistrar.env }} {{- . | toYaml | nindent 12 }} {{- end }} volumeMounts: diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 99c48c7625..e4b287b3b2 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -9,18 +9,21 @@ image: sidecars: provisioner: + env: [] image: repository: k8s.gcr.io/sig-storage/csi-provisioner tag: "v2.1.1" logLevel: 2 resources: {} attacher: + env: [] image: repository: k8s.gcr.io/sig-storage/csi-attacher tag: "v3.1.0" logLevel: 2 resources: {} snapshotter: + env: [] image: repository: k8s.gcr.io/sig-storage/csi-snapshotter tag: "v3.0.3" @@ -32,12 +35,14 @@ sidecars: tag: "v2.2.0" resources: {} resizer: + env: [] image: repository: k8s.gcr.io/sig-storage/csi-resizer tag: "v1.0.0" logLevel: 2 resources: {} nodeDriverRegistrar: + env: [] image: repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar tag: "v2.1.0" @@ -56,17 +61,9 @@ controller: # If arbitrary args like "--aws-sdk-debug-log=true" need to be passed, use this value additionalArgs: [] affinity: {} - # True if enable volume scheduling for dynamic volume provisioning - env: - ebsPlugin: [] - provisioner: [] - attacher: [] - snapshotter: [] - resizer: [] + env: [] # If set, add pv/pvc metadata to plugin create requests as parameters. extraCreateMetadata: true - # Will be removed in later version in favor of env.ebsPlugin - extraVars: {} # Extra volume tags to attach to each dynamically provisioned volume. # --- # extraVolumeTags: @@ -88,10 +85,6 @@ controller: region: replicaCount: 2 resources: {} - serviceAccount: - create: true # A service account will be created for you if set to true. Set to false if you want to use your own. - name: ebs-csi-controller-sa # Name of the service-account to be used/created. - annotations: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -104,6 +97,10 @@ controller: # requests: # cpu: 100m # memory: 128Mi + serviceAccount: + create: true # A service account will be created for you if set to true. Set to false if you want to use your own. + name: ebs-csi-controller-sa # Name of the service-account to be used/created. + annotations: {} tolerations: [] # TSCs without the label selector stanza # @@ -119,9 +116,7 @@ controller: topologySpreadConstraints: [] node: - env: - ebsPlugin: [] - nodeDriverRegistrar: [] + env: [] kubeletPath: /var/lib/kubelet logLevel: 2 priorityClassName: diff --git a/docs/README.md b/docs/README.md index 3f3bc27ffb..2531f9640a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -227,20 +227,25 @@ sidecars: image: ``` -With the above reorganization `controller.containerResources` and `node.containerResources` were also moved into the sidecars structure as follows +With the above reorganization `controller.containerResources`, `controller.env`, `node.containerResources`, and `node.env` were also moved into the sidecars structure as follows ```yaml sidecars: provisioner: + env: [] resources: {} attacher: + env: [] resources: {} snapshotter: + env: [] resources: {} livenessProbe: resources: {} resizer: + env: [] resources: {} nodeDriverRegistrar: + env: [] resources: {} ``` From 6d89302188759cde3308f79bdef9119d470b7fe0 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 6 Jul 2021 14:41:48 -0700 Subject: [PATCH 52/59] Update to csi-proxy v1.0.0-rc.1, run go mod tidy && go mod vendor --- go.mod | 2 +- go.sum | 8 +- vendor/github.com/Microsoft/go-winio/go.mod | 2 +- vendor/github.com/Microsoft/go-winio/go.sum | 6 +- vendor/github.com/Microsoft/go-winio/pipe.go | 4 +- .../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 +++++++++ .../api/filesystem/{v1beta1 => v1}/api.proto | 94 +- .../client/api/filesystem/v1beta1/api.pb.go | 872 -------- .../csi-proxy/client/api/volume/v1/api.pb.go | 1876 +++++++++++++++++ .../csi-proxy/client/api/volume/v1/api.proto | 143 ++ .../client/api/volume/v1beta2/api.pb.go | 1313 ------------ .../client/api/volume/v1beta2/api.proto | 132 -- .../kubernetes-csi/csi-proxy/client/go.mod | 6 +- .../kubernetes-csi/csi-proxy/client/go.sum | 6 + .../client/groups/disk/v1/client_generated.go | 94 + .../groups/disk/v1beta2/client_generated.go | 80 - .../groups/filesystem/v1/client_generated.go | 86 + .../filesystem/v1beta1/client_generated.go | 72 - .../groups/volume/v1/client_generated.go | 106 + .../groups/volume/v1beta2/client_generated.go | 92 - vendor/modules.txt | 16 +- 25 files changed, 4991 insertions(+), 3784 deletions(-) create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.pb.go create 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 create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.pb.go rename vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/{v1beta1 => v1}/api.proto (65%) delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.pb.go create mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.pb.go create 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/v1beta2/api.pb.go delete mode 100644 vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2/api.proto create 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 create 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 create 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/v1beta2/client_generated.go diff --git a/go.mod b/go.mod index 1f8a0b6a47..d091f37afa 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/golang/mock v1.5.0 github.com/golang/protobuf v1.4.3 github.com/imdario/mergo v0.3.7 // indirect - github.com/kubernetes-csi/csi-proxy/client v0.2.2 + github.com/kubernetes-csi/csi-proxy/client v1.0.0-rc.1 github.com/kubernetes-csi/csi-test v2.0.0+incompatible github.com/kubernetes-csi/external-snapshotter/client/v4 v4.0.0 github.com/onsi/ginkgo v1.11.0 diff --git a/go.sum b/go.sum index da7ceecd9b..324951f82a 100644 --- a/go.sum +++ b/go.sum @@ -41,10 +41,10 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20200415212048-7901bc822317/go.mod h1:DF8FZRxMHMGv/vP2lQP6h+dYzzjpuRn24VeRiYn3qjQ= github.com/JeffAshton/win_pdh v0.0.0-20161109143554-76bb4ee9f0ab/go.mod h1:3VYc5hodBMJ5+l/7J4xAyMeuM2PNuepvHlGs8yilUCA= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= -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 h1:qkLXKzb1QoVatRyd/YlXZ/Kg0m5K3SPuoD82jjSOaBc= github.com/Microsoft/go-winio v0.4.15/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/hcsshim v0.8.10-0.20200715222032-5eafd1556990/go.mod h1:ay/0dTb7NsG8QMDfsRfLHgZo/6xAJShLe1+ePPflihk= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= @@ -377,8 +377,8 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= 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 v0.2.2 h1:VpMddHnbYA1oBeU5nrisdyrpOAAT0HqME7fsTi6BG2w= -github.com/kubernetes-csi/csi-proxy/client v0.2.2/go.mod h1:6ptQQmti5QHwBxSsh8Cy00oGdogj0JXewFnu8FFjgOs= +github.com/kubernetes-csi/csi-proxy/client v1.0.0-rc.1 h1:rWwsNUTbgFfUMYGe/w4N+AJAR8Z/wQ1QMgf5JdTlv8g= +github.com/kubernetes-csi/csi-proxy/client v1.0.0-rc.1/go.mod h1:URLOkEbRhOwKVvGvug6HSKRTpLSFuQ/Gt3xahDag8qc= github.com/kubernetes-csi/csi-test v2.0.0+incompatible h1:ia04uVFUM/J9n/v3LEMn3rEG6FmKV5BH9QLw7H68h44= github.com/kubernetes-csi/csi-test v2.0.0+incompatible/go.mod h1:YxJ4UiuPWIhMBkxUKY5c267DyA0uDZ/MtAimhx/2TA0= github.com/kubernetes-csi/external-snapshotter/client/v4 v4.0.0 h1:ipLtV9ubLEYx42YvwDa12eVPQvjuGZoPdbCozGzVNRc= diff --git a/vendor/github.com/Microsoft/go-winio/go.mod b/vendor/github.com/Microsoft/go-winio/go.mod index 50b9d6e2ec..a2eb6496cf 100644 --- a/vendor/github.com/Microsoft/go-winio/go.mod +++ b/vendor/github.com/Microsoft/go-winio/go.mod @@ -3,7 +3,7 @@ module github.com/Microsoft/go-winio go 1.12 require ( - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.4.1 golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 ) diff --git a/vendor/github.com/Microsoft/go-winio/go.sum b/vendor/github.com/Microsoft/go-winio/go.sum index 209aa8cf4d..6da76a492e 100644 --- a/vendor/github.com/Microsoft/go-winio/go.sum +++ b/vendor/github.com/Microsoft/go-winio/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= @@ -12,7 +12,5 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/Microsoft/go-winio/pipe.go b/vendor/github.com/Microsoft/go-winio/pipe.go index ff96dff1c6..96700a73de 100644 --- a/vendor/github.com/Microsoft/go-winio/pipe.go +++ b/vendor/github.com/Microsoft/go-winio/pipe.go @@ -429,10 +429,10 @@ type PipeConfig struct { // when the pipe is in message mode. MessageMode bool - // InputBufferSize specifies the size the input buffer, in bytes. + // InputBufferSize specifies the size of the input buffer, in bytes. InputBufferSize int32 - // OutputBufferSize specifies the size the input buffer, in bytes. + // OutputBufferSize specifies the size of the output buffer, in bytes. OutputBufferSize int32 } 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 new file mode 100644 index 0000000000..70bb981e9b --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.pb.go @@ -0,0 +1,1476 @@ +// 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 new file mode 100644 index 0000000000..f73f412d6e --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/disk/v1/api.proto @@ -0,0 +1,111 @@ +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 27324f1ead..0000000000 --- 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 c9f6c8f8e2..0000000000 --- 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 new file mode 100644 index 0000000000..8bf9cd6548 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.pb.go @@ -0,0 +1,1041 @@ +// 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/v1beta1/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.proto similarity index 65% rename from vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1/api.proto rename to vendor/github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1/api.proto index 3b4c0ab2f4..151a1ffd41 100644 --- 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/v1/api.proto @@ -1,55 +1,37 @@ syntax = "proto3"; -package v1beta1; +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's 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's filesystem + // 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's filesystem. - // This may be used for unlinking a symlink created through LinkPath + // 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) {} - // 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) {} -} + // 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) {} -// 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; + // 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; - - // 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; + bool exists = 1; } message MkdirRequest { @@ -63,7 +45,7 @@ message MkdirRequest { // // 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 + // 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. @@ -72,15 +54,10 @@ message MkdirRequest { // 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; + // Intentionally empty. } message RmdirRequest { @@ -91,7 +68,7 @@ message RmdirRequest { // // 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 + // 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. @@ -101,28 +78,23 @@ message RmdirRequest { // 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; + bool force = 2; } message RmdirResponse { - // Error message if any. Empty string indicates success - string error = 1; + // Intentionally empty. } -message LinkPathRequest { - // The path where the symlink is created in the host's filesystem. +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 + // 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: "\". @@ -131,7 +103,7 @@ message LinkPathRequest { // 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. + // 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 @@ -149,20 +121,16 @@ message LinkPathRequest { string target_path = 2; } -message LinkPathResponse { - // Error message if any. Empty string indicates success - string error = 1; +message CreateSymlinkResponse { + // Intentionally empty. } - -message IsMountPointRequest { - // The path whose existence we want to check in the host's filesystem + +message IsSymlinkRequest { + // The path whose existence as a symlink 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; +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 9b8f897bd3..0000000000 --- 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/volume/v1/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.pb.go new file mode 100644 index 0000000000..2a7a9be184 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.pb.go @@ -0,0 +1,1876 @@ +// 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 new file mode 100644 index 0000000000..a065381041 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1/api.proto @@ -0,0 +1,143 @@ +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/v1beta2/api.pb.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2/api.pb.go deleted file mode 100644 index 2bc4962c9c..0000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2/api.pb.go +++ /dev/null @@ -1,1313 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: client/api/volume/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 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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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_99d2e9a7d1d95ce9, []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 "" -} - -type WriteVolumeCacheRequest struct { - // 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"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WriteVolumeCacheRequest) Reset() { *m = WriteVolumeCacheRequest{} } -func (m *WriteVolumeCacheRequest) String() string { return proto.CompactTextString(m) } -func (*WriteVolumeCacheRequest) ProtoMessage() {} -func (*WriteVolumeCacheRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_99d2e9a7d1d95ce9, []int{18} -} - -func (m *WriteVolumeCacheRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteVolumeCacheRequest.Unmarshal(m, b) -} -func (m *WriteVolumeCacheRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteVolumeCacheRequest.Marshal(b, m, deterministic) -} -func (m *WriteVolumeCacheRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteVolumeCacheRequest.Merge(m, src) -} -func (m *WriteVolumeCacheRequest) XXX_Size() int { - return xxx_messageInfo_WriteVolumeCacheRequest.Size(m) -} -func (m *WriteVolumeCacheRequest) XXX_DiscardUnknown() { - xxx_messageInfo_WriteVolumeCacheRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteVolumeCacheRequest proto.InternalMessageInfo - -func (m *WriteVolumeCacheRequest) GetVolumeId() string { - if m != nil { - return m.VolumeId - } - return "" -} - -type WriteVolumeCacheResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *WriteVolumeCacheResponse) Reset() { *m = WriteVolumeCacheResponse{} } -func (m *WriteVolumeCacheResponse) String() string { return proto.CompactTextString(m) } -func (*WriteVolumeCacheResponse) ProtoMessage() {} -func (*WriteVolumeCacheResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_99d2e9a7d1d95ce9, []int{19} -} - -func (m *WriteVolumeCacheResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WriteVolumeCacheResponse.Unmarshal(m, b) -} -func (m *WriteVolumeCacheResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WriteVolumeCacheResponse.Marshal(b, m, deterministic) -} -func (m *WriteVolumeCacheResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_WriteVolumeCacheResponse.Merge(m, src) -} -func (m *WriteVolumeCacheResponse) XXX_Size() int { - return xxx_messageInfo_WriteVolumeCacheResponse.Size(m) -} -func (m *WriteVolumeCacheResponse) XXX_DiscardUnknown() { - xxx_messageInfo_WriteVolumeCacheResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_WriteVolumeCacheResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*ListVolumesOnDiskRequest)(nil), "v1beta2.ListVolumesOnDiskRequest") - proto.RegisterType((*ListVolumesOnDiskResponse)(nil), "v1beta2.ListVolumesOnDiskResponse") - proto.RegisterType((*MountVolumeRequest)(nil), "v1beta2.MountVolumeRequest") - proto.RegisterType((*MountVolumeResponse)(nil), "v1beta2.MountVolumeResponse") - proto.RegisterType((*DismountVolumeRequest)(nil), "v1beta2.DismountVolumeRequest") - proto.RegisterType((*DismountVolumeResponse)(nil), "v1beta2.DismountVolumeResponse") - proto.RegisterType((*IsVolumeFormattedRequest)(nil), "v1beta2.IsVolumeFormattedRequest") - proto.RegisterType((*IsVolumeFormattedResponse)(nil), "v1beta2.IsVolumeFormattedResponse") - proto.RegisterType((*FormatVolumeRequest)(nil), "v1beta2.FormatVolumeRequest") - proto.RegisterType((*FormatVolumeResponse)(nil), "v1beta2.FormatVolumeResponse") - proto.RegisterType((*ResizeVolumeRequest)(nil), "v1beta2.ResizeVolumeRequest") - proto.RegisterType((*ResizeVolumeResponse)(nil), "v1beta2.ResizeVolumeResponse") - proto.RegisterType((*VolumeStatsRequest)(nil), "v1beta2.VolumeStatsRequest") - proto.RegisterType((*VolumeStatsResponse)(nil), "v1beta2.VolumeStatsResponse") - proto.RegisterType((*VolumeDiskNumberRequest)(nil), "v1beta2.VolumeDiskNumberRequest") - proto.RegisterType((*VolumeDiskNumberResponse)(nil), "v1beta2.VolumeDiskNumberResponse") - proto.RegisterType((*VolumeIDFromMountRequest)(nil), "v1beta2.VolumeIDFromMountRequest") - proto.RegisterType((*VolumeIDFromMountResponse)(nil), "v1beta2.VolumeIDFromMountResponse") - proto.RegisterType((*WriteVolumeCacheRequest)(nil), "v1beta2.WriteVolumeCacheRequest") - proto.RegisterType((*WriteVolumeCacheResponse)(nil), "v1beta2.WriteVolumeCacheResponse") -} - -func init() { - proto.RegisterFile("client/api/volume/v1beta2/api.proto", fileDescriptor_99d2e9a7d1d95ce9) -} - -var fileDescriptor_99d2e9a7d1d95ce9 = []byte{ - // 625 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x6b, 0x6f, 0xd3, 0x30, - 0x14, 0x6d, 0x19, 0x74, 0xeb, 0x05, 0x4d, 0xcc, 0xdd, 0x23, 0xcd, 0x1e, 0x74, 0x46, 0x42, 0xfb, - 0xb2, 0x86, 0x75, 0xd2, 0x80, 0x49, 0x08, 0x09, 0x4a, 0xa1, 0x88, 0x81, 0x94, 0x0a, 0x10, 0x68, - 0xa8, 0x4a, 0x1b, 0x43, 0xad, 0x2e, 0x4d, 0x89, 0x9d, 0x09, 0xf8, 0xc7, 0xfc, 0x0b, 0x14, 0xdb, - 0x49, 0xdd, 0x3c, 0xaa, 0x22, 0xf1, 0x2d, 0x3e, 0xf6, 0x39, 0xe7, 0xda, 0xbe, 0xc7, 0x81, 0xfb, - 0xc3, 0x2b, 0x4a, 0x26, 0xdc, 0x72, 0xa6, 0xd4, 0xba, 0xf6, 0xaf, 0x42, 0x8f, 0x58, 0xd7, 0x27, - 0x03, 0xc2, 0x9d, 0x56, 0x04, 0x35, 0xa7, 0x81, 0xcf, 0x7d, 0xb4, 0xaa, 0x20, 0x7c, 0x0a, 0xc6, - 0x5b, 0xca, 0xf8, 0x47, 0xb1, 0x90, 0xbd, 0x9f, 0xb4, 0x29, 0x1b, 0xdb, 0xe4, 0x47, 0x48, 0x18, - 0x47, 0x3b, 0xb0, 0xea, 0x52, 0x36, 0xee, 0x53, 0xd7, 0x28, 0x37, 0xca, 0x47, 0x55, 0xbb, 0x12, - 0x0d, 0xbb, 0x2e, 0x3e, 0x87, 0x7a, 0x0e, 0x89, 0x4d, 0xfd, 0x09, 0x23, 0x68, 0x1f, 0x40, 0xda, - 0xf6, 0xa9, 0xcb, 0x8c, 0x72, 0x63, 0xe5, 0xa8, 0x6a, 0x57, 0x25, 0xd2, 0x75, 0x19, 0x7e, 0x09, - 0xe8, 0xc2, 0x0f, 0x27, 0x8a, 0x1c, 0x5b, 0xed, 0x42, 0x35, 0x21, 0x29, 0xb3, 0xb5, 0x98, 0x83, - 0x10, 0xdc, 0x9c, 0x3a, 0x7c, 0x64, 0xdc, 0x10, 0xb8, 0xf8, 0xc6, 0x5b, 0x50, 0x9b, 0x93, 0x91, - 0xe6, 0xf8, 0x35, 0x6c, 0xb5, 0x29, 0xf3, 0xfe, 0x83, 0x81, 0x01, 0xdb, 0x69, 0x25, 0xe5, 0xf1, - 0x08, 0x8c, 0x2e, 0x93, 0x58, 0xc7, 0x0f, 0x3c, 0x87, 0x73, 0xe2, 0x2e, 0x63, 0x83, 0x9f, 0x40, - 0x3d, 0x87, 0xa8, 0x8e, 0x6d, 0x0f, 0xaa, 0xdf, 0x62, 0x50, 0x30, 0xd7, 0xec, 0x19, 0x80, 0x5b, - 0x50, 0x93, 0x94, 0xe5, 0x77, 0x85, 0xb7, 0x61, 0x73, 0x9e, 0xa3, 0xea, 0xef, 0x40, 0xcd, 0x26, - 0x8c, 0xfe, 0x26, 0xff, 0x76, 0x42, 0x11, 0x43, 0x9c, 0xd0, 0x8a, 0x2d, 0xbe, 0x23, 0xfd, 0x79, - 0x1d, 0xa5, 0x7f, 0x02, 0x48, 0x22, 0x3d, 0xee, 0x70, 0xb6, 0x54, 0xa9, 0x5f, 0xa1, 0x36, 0x47, - 0x51, 0x67, 0x72, 0x10, 0xb7, 0x52, 0x2f, 0xf2, 0x2e, 0x0b, 0x6f, 0x0d, 0x41, 0x0f, 0x60, 0x5d, - 0x8e, 0x3e, 0x30, 0xe2, 0xf6, 0x66, 0xf5, 0xa5, 0x50, 0x7c, 0x06, 0x3b, 0x52, 0x3e, 0x6a, 0xd4, - 0x77, 0xa1, 0x37, 0x20, 0xc1, 0x52, 0x65, 0x9d, 0x83, 0x91, 0xe5, 0xcd, 0x6a, 0x73, 0x13, 0x34, - 0xae, 0x6d, 0x86, 0xe0, 0x87, 0x31, 0xb7, 0xdb, 0xee, 0x04, 0xbe, 0x27, 0x9a, 0x35, 0x36, 0xdd, - 0x84, 0x5b, 0xa2, 0xb1, 0x94, 0xa1, 0x1c, 0xe0, 0xc7, 0x50, 0xcf, 0x61, 0x28, 0xbb, 0x85, 0x75, - 0x9e, 0xc1, 0xce, 0xa7, 0x80, 0x72, 0x75, 0x11, 0x2f, 0x9c, 0xe1, 0x68, 0xb9, 0x0e, 0x31, 0xc1, - 0xc8, 0xf2, 0xa4, 0x61, 0xeb, 0x4f, 0x05, 0x2a, 0x12, 0x47, 0x97, 0xb0, 0x91, 0x89, 0x3b, 0x3a, - 0x6c, 0xaa, 0x27, 0xa4, 0x59, 0xf4, 0x7e, 0x98, 0x78, 0xd1, 0x12, 0xd5, 0x2c, 0x25, 0xf4, 0x06, - 0x6e, 0x6b, 0x49, 0x46, 0xbb, 0x09, 0x29, 0xfb, 0x4c, 0x98, 0x7b, 0xf9, 0x93, 0x89, 0x56, 0x0f, - 0xd6, 0xe7, 0x43, 0x8b, 0x0e, 0x12, 0x46, 0xee, 0xbb, 0x60, 0xde, 0x2b, 0x9c, 0x4f, 0x44, 0x2f, - 0x61, 0x23, 0x13, 0x5b, 0x6d, 0xfb, 0x45, 0x6f, 0x81, 0xb6, 0xfd, 0xc2, 0xd4, 0xe3, 0x12, 0xba, - 0x80, 0x3b, 0x7a, 0x4a, 0xd1, 0x6c, 0x8b, 0x39, 0x81, 0x37, 0xf7, 0x0b, 0x66, 0x75, 0x39, 0x3d, - 0x94, 0x9a, 0x5c, 0x4e, 0xe6, 0x35, 0xb9, 0xdc, 0x24, 0x8b, 0xcb, 0xd1, 0x82, 0xa9, 0x5d, 0x4e, - 0x36, 0xe1, 0xda, 0xe5, 0xe4, 0x64, 0x59, 0x9c, 0x63, 0xed, 0x15, 0xe1, 0xe9, 0x40, 0xa1, 0x46, - 0x8a, 0x96, 0xc9, 0xa8, 0x79, 0xb8, 0x60, 0x45, 0xa2, 0xde, 0x87, 0xcd, 0x44, 0x5d, 0x0b, 0x10, - 0x4a, 0x93, 0xb3, 0x71, 0xd4, 0x2e, 0xaa, 0x30, 0x7f, 0xb8, 0x84, 0x3e, 0xc3, 0xdd, 0x74, 0x58, - 0xb4, 0xda, 0x0b, 0xf2, 0xa7, 0xd5, 0x5e, 0x94, 0x34, 0x5c, 0x7a, 0xfe, 0xec, 0xcb, 0xd3, 0xef, - 0x94, 0x8f, 0xc2, 0x41, 0x73, 0xe8, 0x7b, 0xd6, 0x38, 0x1c, 0x90, 0x60, 0x42, 0x38, 0x61, 0xc7, - 0x43, 0x46, 0xad, 0x21, 0xa3, 0xc7, 0xd3, 0xc0, 0xff, 0xf9, 0xcb, 0x2a, 0xfc, 0xb1, 0x0f, 0x2a, - 0xe2, 0xaf, 0x7e, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0xef, 0xbc, 0x51, 0x38, 0xfc, 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) - // WriteVolumeCache write volume cache to disk - WriteVolumeCache(ctx context.Context, in *WriteVolumeCacheRequest, opts ...grpc.CallOption) (*WriteVolumeCacheResponse, 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, "/v1beta2.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, "/v1beta2.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, "/v1beta2.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, "/v1beta2.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, "/v1beta2.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, "/v1beta2.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, "/v1beta2.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, "/v1beta2.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, "/v1beta2.Volume/GetVolumeIDFromMount", 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, "/v1beta2.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 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) - // 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(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 (*UnimplementedVolumeServer) WriteVolumeCache(ctx context.Context, req *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: "/v1beta2.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: "/v1beta2.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: "/v1beta2.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: "/v1beta2.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: "/v1beta2.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: "/v1beta2.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: "/v1beta2.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: "/v1beta2.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: "/v1beta2.Volume/GetVolumeIDFromMount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VolumeServer).GetVolumeIDFromMount(ctx, req.(*VolumeIDFromMountRequest)) - } - 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: "/v1beta2.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: "v1beta2.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, - }, - { - MethodName: "WriteVolumeCache", - Handler: _Volume_WriteVolumeCache_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "client/api/volume/v1beta2/api.proto", -} diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2/api.proto b/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2/api.proto deleted file mode 100644 index c88e1f57e9..0000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2/api.proto +++ /dev/null @@ -1,132 +0,0 @@ -syntax = "proto3"; - -package v1beta2; - -option go_package = "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2"; - -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) {} - // WriteVolumeCache write volume cache to disk - rpc WriteVolumeCache(WriteVolumeCacheRequest) returns (WriteVolumeCacheResponse) {} -} - -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; -} - -message WriteVolumeCacheRequest { - // Volume device ID of the volume to flush the cache - string volume_id = 1; -} - -message WriteVolumeCacheResponse { - // Intentionally empty -} \ No newline at end of file diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/go.mod b/vendor/github.com/kubernetes-csi/csi-proxy/client/go.mod index 85501884a1..5fedd0365e 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/go.mod +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/go.mod @@ -1,11 +1,11 @@ module github.com/kubernetes-csi/csi-proxy/client -go 1.12 +go 1.16 require ( - github.com/Microsoft/go-winio v0.4.14 + github.com/Microsoft/go-winio v0.4.16 github.com/golang/protobuf v1.4.1 - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.2.2 google.golang.org/grpc v1.27.0 google.golang.org/protobuf v1.25.0 diff --git a/vendor/github.com/kubernetes-csi/csi-proxy/client/go.sum b/vendor/github.com/kubernetes-csi/csi-proxy/client/go.sum index 7b2beee327..a5931e299d 100644 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/go.sum +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/go.sum @@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -30,6 +32,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -56,6 +60,8 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3 h1:7TYNF4UdlohbFwpNH04CoPMp1cHUZgO1Ebq5r2hIjfo= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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 new file mode 100644 index 0000000000..524814e958 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1/client_generated.go @@ -0,0 +1,94 @@ +// 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" + v1 "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 a5e85d8131..0000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2/client_generated.go +++ /dev/null @@ -1,80 +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" -) - -const groupName = "disk" - -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) - - 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 new file mode 100644 index 0000000000..b3ffc7fa73 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1/client_generated.go @@ -0,0 +1,86 @@ +// 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" + v1 "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 a68e86fa9b..0000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1/client_generated.go +++ /dev/null @@ -1,72 +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" -) - -const groupName = "filesystem" - -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) - - 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 new file mode 100644 index 0000000000..659ed34b83 --- /dev/null +++ b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1/client_generated.go @@ -0,0 +1,106 @@ +// 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" + v1 "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/v1beta2/client_generated.go b/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta2/client_generated.go deleted file mode 100644 index a558a042ac..0000000000 --- a/vendor/github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta2/client_generated.go +++ /dev/null @@ -1,92 +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/volume/v1beta2" - "github.com/kubernetes-csi/csi-proxy/client/apiversion" - "google.golang.org/grpc" -) - -const groupName = "volume" - -var version = apiversion.NewVersionOrPanic("v1beta2") - -type Client struct { - client v1beta2.VolumeClient - connection *grpc.ClientConn -} - -// NewClient returns a client to make calls to the volume 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) - - 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.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 _ v1beta2.VolumeClient = &Client{} - -func (w *Client) DismountVolume(context context.Context, request *v1beta2.DismountVolumeRequest, opts ...grpc.CallOption) (*v1beta2.DismountVolumeResponse, error) { - return w.client.DismountVolume(context, request, opts...) -} - -func (w *Client) FormatVolume(context context.Context, request *v1beta2.FormatVolumeRequest, opts ...grpc.CallOption) (*v1beta2.FormatVolumeResponse, error) { - return w.client.FormatVolume(context, request, opts...) -} - -func (w *Client) GetVolumeDiskNumber(context context.Context, request *v1beta2.VolumeDiskNumberRequest, opts ...grpc.CallOption) (*v1beta2.VolumeDiskNumberResponse, error) { - return w.client.GetVolumeDiskNumber(context, request, opts...) -} - -func (w *Client) GetVolumeIDFromMount(context context.Context, request *v1beta2.VolumeIDFromMountRequest, opts ...grpc.CallOption) (*v1beta2.VolumeIDFromMountResponse, error) { - return w.client.GetVolumeIDFromMount(context, request, opts...) -} - -func (w *Client) IsVolumeFormatted(context context.Context, request *v1beta2.IsVolumeFormattedRequest, opts ...grpc.CallOption) (*v1beta2.IsVolumeFormattedResponse, error) { - return w.client.IsVolumeFormatted(context, request, opts...) -} - -func (w *Client) ListVolumesOnDisk(context context.Context, request *v1beta2.ListVolumesOnDiskRequest, opts ...grpc.CallOption) (*v1beta2.ListVolumesOnDiskResponse, error) { - return w.client.ListVolumesOnDisk(context, request, opts...) -} - -func (w *Client) MountVolume(context context.Context, request *v1beta2.MountVolumeRequest, opts ...grpc.CallOption) (*v1beta2.MountVolumeResponse, error) { - return w.client.MountVolume(context, request, opts...) -} - -func (w *Client) ResizeVolume(context context.Context, request *v1beta2.ResizeVolumeRequest, opts ...grpc.CallOption) (*v1beta2.ResizeVolumeResponse, error) { - return w.client.ResizeVolume(context, request, opts...) -} - -func (w *Client) VolumeStats(context context.Context, request *v1beta2.VolumeStatsRequest, opts ...grpc.CallOption) (*v1beta2.VolumeStatsResponse, error) { - return w.client.VolumeStats(context, request, opts...) -} - -func (w *Client) WriteVolumeCache(context context.Context, request *v1beta2.WriteVolumeCacheRequest, opts ...grpc.CallOption) (*v1beta2.WriteVolumeCacheResponse, error) { - return w.client.WriteVolumeCache(context, request, opts...) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index b0f658f08b..4e204f7289 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/Microsoft/go-winio v0.4.15 +# github.com/Microsoft/go-winio v0.4.16 github.com/Microsoft/go-winio github.com/Microsoft/go-winio/pkg/guid # github.com/aws/aws-sdk-go v1.35.37 @@ -113,16 +113,16 @@ github.com/imdario/mergo github.com/jmespath/go-jmespath # github.com/json-iterator/go v1.1.10 github.com/json-iterator/go -# github.com/kubernetes-csi/csi-proxy/client v0.2.2 +# github.com/kubernetes-csi/csi-proxy/client v1.0.0-rc.1 ## explicit github.com/kubernetes-csi/csi-proxy/client -github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2 -github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1 -github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2 +github.com/kubernetes-csi/csi-proxy/client/api/disk/v1 +github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1 +github.com/kubernetes-csi/csi-proxy/client/api/volume/v1 github.com/kubernetes-csi/csi-proxy/client/apiversion -github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2 -github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1 -github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta2 +github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1 +github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1 +github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1 # github.com/kubernetes-csi/csi-test v2.0.0+incompatible ## explicit github.com/kubernetes-csi/csi-test/pkg/sanity From 7d9d6c754d9957913cfd242cccaa0e43f0b29584 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 6 Jul 2021 15:01:21 -0700 Subject: [PATCH 53/59] Update to csi-proxy v1 APIs --- pkg/driver/node_windows.go | 9 ++-- pkg/mounter/safe_mounter_windows.go | 64 +++++++++++++++-------------- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/pkg/driver/node_windows.go b/pkg/driver/node_windows.go index 715a403a72..3a46c8ce76 100644 --- a/pkg/driver/node_windows.go +++ b/pkg/driver/node_windows.go @@ -22,10 +22,11 @@ import ( "context" "errors" "fmt" + "strconv" "strings" - diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2" - diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2" + diskapi "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" + diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1" "github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/mounter" "k8s.io/klog" ) @@ -49,10 +50,10 @@ func (d *nodeService) findDevicePath(devicePath, volumeID, _ string) (string, er foundDiskNumber := "" for diskNumber, diskID := range diskIDs { - serialNumber := diskID.Identifiers["serialNumber"] + serialNumber := diskID.GetSerialNumber() cleanVolumeID := strings.ReplaceAll(volumeID, "-", "") if strings.Contains(serialNumber, cleanVolumeID) { - foundDiskNumber = diskNumber + foundDiskNumber = strconv.Itoa(int(diskNumber)) break } } diff --git a/pkg/mounter/safe_mounter_windows.go b/pkg/mounter/safe_mounter_windows.go index 35a3277d78..c1a50c55c3 100644 --- a/pkg/mounter/safe_mounter_windows.go +++ b/pkg/mounter/safe_mounter_windows.go @@ -22,16 +22,17 @@ import ( "context" "fmt" "os" + "strconv" "strings" - disk "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1beta2" - diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1beta2" + disk "github.com/kubernetes-csi/csi-proxy/client/api/disk/v1" + diskclient "github.com/kubernetes-csi/csi-proxy/client/groups/disk/v1" - fs "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1beta1" - fsclient "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1" + fs "github.com/kubernetes-csi/csi-proxy/client/api/filesystem/v1" + fsclient "github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1" - volume "github.com/kubernetes-csi/csi-proxy/client/api/volume/v1beta2" - volumeclient "github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta2" + volume "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" "k8s.io/mount-utils" @@ -58,11 +59,11 @@ func normalizeWindowsPath(path string) string { func (mounter *CSIProxyMounter) Mount(source string, target string, fstype string, options []string) error { // Mount is called after the format is done. // TODO: Confirm that fstype is empty. - linkRequest := &fs.LinkPathRequest{ + linkRequest := &fs.CreateSymlinkRequest{ SourcePath: normalizeWindowsPath(source), TargetPath: normalizeWindowsPath(target), } - _, err := mounter.FsClient.LinkPath(context.Background(), linkRequest) + _, err := mounter.FsClient.CreateSymlink(context.Background(), linkRequest) if err != nil { return err } @@ -75,9 +76,8 @@ func (mounter *CSIProxyMounter) Mount(source string, target string, fstype strin // rmdir with either pod or plugin context. func (mounter *CSIProxyMounter) Rmdir(path string) error { rmdirRequest := &fs.RmdirRequest{ - Path: normalizeWindowsPath(path), - Context: fs.PathContext_POD, - Force: true, + Path: normalizeWindowsPath(path), + Force: true, } _, err := mounter.FsClient.Rmdir(context.Background(), rmdirRequest) if err != nil { @@ -89,9 +89,9 @@ func (mounter *CSIProxyMounter) Rmdir(path string) error { // Unmount - Removes the directory - equivalent to unmount on Linux. func (mounter *CSIProxyMounter) Unmount(target string) error { // WriteVolumeCache before unmount - response, err := mounter.VolumeClient.GetVolumeIDFromMount(context.Background(), &volume.VolumeIDFromMountRequest{Mount: target}) + response, err := mounter.VolumeClient.GetVolumeIDFromTargetPath(context.Background(), &volume.GetVolumeIDFromTargetPathRequest{TargetPath: target}) if err != nil || response == nil { - klog.Warningf("GetVolumeIDFromMount(%s) failed with error: %v, response: %v", target, err, response) + klog.Warningf("GetVolumeIDFromTargetPath(%s) failed with error: %v, response: %v", target, err, response) } else { request := &volume.WriteVolumeCacheRequest{ VolumeId: response.VolumeId, @@ -124,14 +124,14 @@ func (mounter *CSIProxyMounter) IsLikelyNotMountPoint(path string) (bool, error) return true, os.ErrNotExist } - response, err := mounter.FsClient.IsMountPoint(context.Background(), - &fs.IsMountPointRequest{ + response, err := mounter.FsClient.IsSymlink(context.Background(), + &fs.IsSymlinkRequest{ Path: normalizeWindowsPath(path), }) if err != nil { return false, err } - return !response.IsMountPoint, nil + return !response.IsSymlink, nil } func (mounter *CSIProxyMounter) PathIsDevice(pathname string) (bool, error) { @@ -144,8 +144,8 @@ func (mounter *CSIProxyMounter) DeviceOpened(pathname string) (bool, error) { // GetDeviceNameFromMount returns the volume ID for a mount path. func (mounter *CSIProxyMounter) GetDeviceNameFromMount(mountPath, pluginMountDir string) (string, error) { - req := &volume.VolumeIDFromMountRequest{Mount: normalizeWindowsPath(mountPath)} - resp, err := mounter.VolumeClient.GetVolumeIDFromMount(context.Background(), req) + req := &volume.GetVolumeIDFromTargetPathRequest{TargetPath: normalizeWindowsPath(mountPath)} + resp, err := mounter.VolumeClient.GetVolumeIDFromTargetPath(context.Background(), req) if err != nil { return "", err } @@ -166,8 +166,7 @@ func (mounter *CSIProxyMounter) MakeFile(pathname string) error { // with Plugin context.. func (mounter *CSIProxyMounter) MakeDir(pathname string) error { mkdirReq := &fs.MkdirRequest{ - Path: normalizeWindowsPath(pathname), - Context: fs.PathContext_PLUGIN, + Path: normalizeWindowsPath(pathname), } _, err := mounter.FsClient.Mkdir(context.Background(), mkdirReq) if err != nil { @@ -238,7 +237,7 @@ func (mounter *CSIProxyMounter) FindDiskByLun(lun string) (diskNum string, err e // If match is found then return back the disk number. for diskID, location := range findDiskByLunResponse.DiskLocations { if strings.EqualFold(location.LUNID, lun) { - return diskID, nil + return strconv.Itoa(int(diskID)), nil } } return "", fmt.Errorf("could not find disk id for lun: %s", lun) @@ -246,18 +245,23 @@ func (mounter *CSIProxyMounter) FindDiskByLun(lun string) (diskNum string, err e // FormatAndMount - accepts the source disk number, target path to mount, the fstype to format with and options to be used. func (mounter *CSIProxyMounter) FormatAndMount(source string, target string, fstype string, options []string) error { + diskNumber, err := strconv.Atoi(source) + if err != nil { + return err + } + // Call PartitionDisk CSI proxy call to partition the disk and return the volume id partionDiskRequest := &disk.PartitionDiskRequest{ - DiskID: source, + DiskNumber: uint32(diskNumber), } - _, err := mounter.DiskClient.PartitionDisk(context.Background(), partionDiskRequest) + _, err = mounter.DiskClient.PartitionDisk(context.Background(), partionDiskRequest) if err != nil { return err } // List the volumes on the given disk. volumeIDsRequest := &volume.ListVolumesOnDiskRequest{ - DiskId: source, + DiskNumber: uint32(diskNumber), } volumeIdResponse, err := mounter.VolumeClient.ListVolumesOnDisk(context.Background(), volumeIDsRequest) if err != nil { @@ -291,8 +295,8 @@ func (mounter *CSIProxyMounter) FormatAndMount(source string, target string, fst // Mount the volume by calling the CSI proxy call. mountVolumeRequest := &volume.MountVolumeRequest{ - VolumeId: volumeID, - Path: normalizeWindowsPath(target), + VolumeId: volumeID, + TargetPath: normalizeWindowsPath(target), } _, err = mounter.VolumeClient.MountVolume(context.Background(), mountVolumeRequest) if err != nil { @@ -303,7 +307,7 @@ func (mounter *CSIProxyMounter) FormatAndMount(source string, target string, fst // ResizeVolume resizes the volume to the maximum available size. func (mounter *CSIProxyMounter) ResizeVolume(devicePath string) error { - req := &volume.ResizeVolumeRequest{VolumeId: devicePath, Size: 0} + req := &volume.ResizeVolumeRequest{VolumeId: devicePath, SizeBytes: 0} _, err := mounter.VolumeClient.ResizeVolume(context.Background(), req) if err != nil { @@ -315,14 +319,14 @@ func (mounter *CSIProxyMounter) ResizeVolume(devicePath string) error { // GetVolumeSizeInBytes returns the size of the volume in bytes. func (mounter *CSIProxyMounter) GetVolumeSizeInBytes(devicePath string) (int64, error) { - req := &volume.VolumeStatsRequest{VolumeId: devicePath} + req := &volume.GetVolumeStatsRequest{VolumeId: devicePath} - resp, err := mounter.VolumeClient.VolumeStats(context.Background(), req) + resp, err := mounter.VolumeClient.GetVolumeStats(context.Background(), req) if err != nil { return -1, err } - return resp.VolumeSize, nil + return resp.TotalBytes, nil } // NewCSIProxyMounter - creates a new CSI Proxy mounter struct which encompassed all the From a2261de64dc40194a3c698f14f3f71a5cc994361 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 7 Jul 2021 15:19:47 -0700 Subject: [PATCH 54/59] Update windows daemonset to csiproxy v1 paths --- .../aws-ebs-csi-driver/templates/node-windows.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/node-windows.yaml b/charts/aws-ebs-csi-driver/templates/node-windows.yaml index 4502e8da73..98b23d0016 100644 --- a/charts/aws-ebs-csi-driver/templates/node-windows.yaml +++ b/charts/aws-ebs-csi-driver/templates/node-windows.yaml @@ -77,11 +77,11 @@ spec: - name: plugin-dir mountPath: C:\csi - name: csi-proxy-disk-pipe - mountPath: \\.\pipe\csi-proxy-disk-v1beta2 + mountPath: \\.\pipe\csi-proxy-disk-v1 - name: csi-proxy-volume-pipe - mountPath: \\.\pipe\csi-proxy-volume-v1beta2 + mountPath: \\.\pipe\csi-proxy-volume-v1 - name: csi-proxy-filesystem-pipe - mountPath: \\.\pipe\csi-proxy-filesystem-v1beta1 + mountPath: \\.\pipe\csi-proxy-filesystem-v1 ports: - name: healthz containerPort: 9808 @@ -155,13 +155,13 @@ spec: type: Directory - name: csi-proxy-disk-pipe hostPath: - path: \\.\pipe\csi-proxy-disk-v1beta2 + path: \\.\pipe\csi-proxy-disk-v1 type: "" - name: csi-proxy-volume-pipe hostPath: - path: \\.\pipe\csi-proxy-volume-v1beta2 + path: \\.\pipe\csi-proxy-volume-v1 type: "" - name: csi-proxy-filesystem-pipe hostPath: - path: \\.\pipe\csi-proxy-filesystem-v1beta1 + path: \\.\pipe\csi-proxy-filesystem-v1 type: "" From 4aef531a707ac0faac2a307e5e34ebc066c2c214 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 7 Jul 2021 15:28:20 -0700 Subject: [PATCH 55/59] Update windows example prerequisites to latest (planned) versions of csi-proxy/driver --- examples/kubernetes/windows/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/kubernetes/windows/README.md b/examples/kubernetes/windows/README.md index 06f0083ace..0b092ae6c2 100644 --- a/examples/kubernetes/windows/README.md +++ b/examples/kubernetes/windows/README.md @@ -8,9 +8,9 @@ This example shows how to create a EBS volume and consume it from a Windows cont ## Prerequisites 1. A 1.18+ Windows node. Windows support has only been tested on 1.18 EKS Windows nodes. https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html -2. [csi-proxy](https://github.com/kubernetes-csi/csi-proxy) built from commit c201c0afb8f12ceac6d5d778270c2702ca563889 or newer installed on the Windows node. -3. The driver vX.Y.Z+ (TODO: no such version exists yet) Node plugin (DaemonSet) installed on the Windows node. -4. The driver vX.Y.Z+ (TODO: no such version exists yet) Controller plugin (Deployment) installed on a Linux node. The Controller hasn't been tested on Windows. +2. [csi-proxy](https://github.com/kubernetes-csi/csi-proxy) v1.0.0+ installed on the Windows node. +3. The driver v1.2.0+ Node plugin (DaemonSet) installed on the Windows node. +4. The driver v1.2.0+ Controller plugin (Deployment) installed on a Linux node (as it cannot run on a Windows node). ## Usage From d1416bc2c9fb952eb63b68f568f1cf0b5726c5ec Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Thu, 8 Jul 2021 12:57:08 -0700 Subject: [PATCH 56/59] Add WINDOWS bool to hack/e2e/run.sh for creating eksctl windows node group --- hack/e2e/eksctl.sh | 15 ++++++++++++++- hack/e2e/run.sh | 6 +++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/hack/e2e/eksctl.sh b/hack/e2e/eksctl.sh index a185f7f2e7..3916a1444f 100644 --- a/hack/e2e/eksctl.sh +++ b/hack/e2e/eksctl.sh @@ -23,6 +23,7 @@ function eksctl_create_cluster() { KUBECONFIG=${8} EKSCTL_PATCH_FILE=${9} EKSCTL_ADMIN_ROLE=${10} + WINDOWS=${11} generate_ssh_key "${SSH_KEY_PATH}" @@ -58,13 +59,25 @@ function eksctl_create_cluster() { loudecho "Getting cluster ${CLUSTER_NAME}" ${BIN} get cluster "${CLUSTER_NAME}" - if [ -n "$EKSCTL_ADMIN_ROLE" ]; then + if [[ -n "$EKSCTL_ADMIN_ROLE" ]]; then AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) ADMIN_ARN="arn:aws:iam::${AWS_ACCOUNT_ID}:role/${EKSCTL_ADMIN_ROLE}" loudecho "Granting ${ADMIN_ARN} admin access to the cluster" ${BIN} create iamidentitymapping --cluster "${CLUSTER_NAME}" --arn "${ADMIN_ARN}" --group system:masters --username admin fi + if [[ "$WINDOWS" == true ]]; then + ${BIN} create nodegroup \ + --cluster="${CLUSTER_NAME}" \ + --node-ami-family=WindowsServer2019FullContainer \ + -n ng-windows \ + -m 1 \ + -M 1 \ + --ssh-access \ + --ssh-public-key "${SSH_KEY_PATH}".pub + ${BIN} utils install-vpc-controllers --cluster="${CLUSTER_NAME}" --approve + fi + return $? } diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index 9de96cf4ee..bbefc4fd54 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -60,6 +60,9 @@ KOPS_PATCH_NODE_FILE=${KOPS_PATCH_NODE_FILE:-./hack/kops-patch-node.yaml} EKSCTL_VERSION=${EKSCTL_VERSION:-0.56.0-rc.1} EKSCTL_PATCH_FILE=${EKSCTL_PATCH_FILE:-./hack/eksctl-patch.yaml} EKSCTL_ADMIN_ROLE=${EKSCTL_ADMIN_ROLE:-} +# Creates a windows node group. The windows ami doesn't (yet) install csi-proxy +# so that has to be done separately. +WINDOWS=${WINDOWS:-"false"} HELM_VALUES_FILE=${HELM_VALUES_FILE:-./hack/values.yaml} HELM_EXTRA_FLAGS=${HELM_EXTRA_FLAGS:-} @@ -139,7 +142,8 @@ elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then "$CLUSTER_FILE" \ "$KUBECONFIG" \ "$EKSCTL_PATCH_FILE" \ - "$EKSCTL_ADMIN_ROLE" + "$EKSCTL_ADMIN_ROLE" \ + "$WINDOWS" if [[ $? -ne 0 ]]; then exit 1 fi From 9c98a431d8b76e124a2731663623c58d8ae468ca Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 13 Jul 2021 11:10:05 -0700 Subject: [PATCH 57/59] Update windows daemonset to better match helm chart v2 linux daemonset --- .../templates/node-windows.yaml | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/charts/aws-ebs-csi-driver/templates/node-windows.yaml b/charts/aws-ebs-csi-driver/templates/node-windows.yaml index 98b23d0016..5b1096b17a 100644 --- a/charts/aws-ebs-csi-driver/templates/node-windows.yaml +++ b/charts/aws-ebs-csi-driver/templates/node-windows.yaml @@ -2,7 +2,6 @@ kind: DaemonSet apiVersion: apps/v1 metadata: name: ebs-csi-node-windows - namespace: kube-system labels: {{- include "aws-ebs-csi-driver.labels" . | nindent 4 }} spec: @@ -15,8 +14,12 @@ spec: labels: app: ebs-csi-node {{- include "aws-ebs-csi-driver.labels" . | nindent 8 }} - {{- if .Values.node.podAnnotations }} - annotations: {{ toYaml .Values.node.podAnnotations | nindent 8 }} + {{- if .Values.node.podLabels }} + {{- toYaml .Values.node.podLabels | nindent 8 }} + {{- end }} + {{- with .Values.node.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} {{- end }} spec: affinity: @@ -31,10 +34,10 @@ spec: nodeSelector: kubernetes.io/os: windows {{- with .Values.node.nodeSelector }} -{{ toYaml . | indent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ .Values.node.serviceAccount.name }} - priorityClassName: {{ .Values.node.priorityClassName | default "system-cluster-critical" }} + priorityClassName: {{ .Values.node.priorityClassName | default "system-node-critical" }} tolerations: {{- if .Values.node.tolerateAllTaints }} - operator: Exists @@ -46,7 +49,7 @@ spec: tolerationSeconds: 300 {{- end }} {{- with .Values.node.tolerations }} -{{ toYaml . | indent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} containers: - name: ebs-plugin @@ -62,14 +65,16 @@ spec: env: - name: CSI_ENDPOINT value: unix:/csi/csi.sock -{{- if .Values.proxy.http_proxy }} - - name: HTTP_PROXY - value: {{ .Values.proxy.http_proxy | quote }} - - name: HTTPS_PROXY - value: {{ .Values.proxy.http_proxy | quote }} - - name: NO_PROXY - value: {{ .Values.proxy.no_proxy | quote }} -{{- end }} + - name: CSI_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + {{- if .Values.proxy.http_proxy }} + {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} + {{- end }} + {{- with .Values.node.env }} + {{- . | toYaml | nindent 12 }} + {{- end }} volumeMounts: - name: kubelet-dir mountPath: C:\var\lib\kubelet @@ -95,7 +100,8 @@ spec: periodSeconds: 10 failureThreshold: 5 {{- with .Values.node.resources }} - resources: {{ toYaml . | nindent 12 }} + resources: + {{- toYaml . | nindent 12 }} {{- end }} - name: node-driver-registrar image: {{ printf "%s:%s" .Values.sidecars.nodeDriverRegistrar.image.repository .Values.sidecars.nodeDriverRegistrar.image.tag }} @@ -108,21 +114,20 @@ spec: value: unix:/csi/csi.sock - name: DRIVER_REG_SOCK_PATH value: C:\var\lib\kubelet\plugins\ebs.csi.aws.com\csi.sock -{{- if .Values.proxy.http_proxy }} - - name: HTTP_PROXY - value: {{ .Values.proxy.http_proxy | quote }} - - name: HTTPS_PROXY - value: {{ .Values.proxy.http_proxy | quote }} - - name: NO_PROXY - value: {{ .Values.proxy.no_proxy | quote }} -{{- end }} + {{- if .Values.proxy.http_proxy }} + {{- include "aws-ebs-csi-driver.http-proxy" . | nindent 12 }} + {{- end }} + {{- with .Values.sidecars.nodeDriverRegistrar.env }} + {{- . | toYaml | nindent 12 }} + {{- end }} volumeMounts: - name: plugin-dir mountPath: C:\csi - name: registration-dir mountPath: C:\registration {{- with default .Values.node.resources .Values.sidecars.nodeDriverRegistrar.resources }} - resources: {{ toYaml . | nindent 12 }} + resources: + {{- toYaml . | nindent 12 }} {{- end }} - name: liveness-probe image: {{ printf "%s:%s" .Values.sidecars.livenessProbe.image.repository .Values.sidecars.livenessProbe.image.tag }} @@ -132,7 +137,8 @@ spec: - name: plugin-dir mountPath: C:\csi {{- with default .Values.node.resources .Values.sidecars.livenessProbe.resources }} - resources: {{ toYaml . | nindent 12 }} + resources: + {{- toYaml . | nindent 12 }} {{- end }} {{- if .Values.imagePullSecrets }} imagePullSecrets: From 3254a8d116bb743e84f12da6ff49255dcad71f99 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 13 Jul 2021 14:31:46 -0700 Subject: [PATCH 58/59] Add how to consume new hack/e2e scripts in other repos (efs/fsx) --- hack/e2e/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hack/e2e/README.md b/hack/e2e/README.md index 538f0aa021..d245cd31b0 100644 --- a/hack/e2e/README.md +++ b/hack/e2e/README.md @@ -41,7 +41,16 @@ To commit changes and submit them as a PR back to the ebs repo: ``` git diff ebs/master:hack/e2e HEAD:hack/e2e > /tmp/hack_e2e.diff -cd $GOPATH/src/github.com/kubernetes-sigs/aws-ebs-csi-driver +pushd $GOPATH/src/github.com/kubernetes-sigs/aws-ebs-csi-driver +git apply --reject --directory hack/e2e /tmp/hack_e2e.diff +git commit +``` + +To consume newer changes from the ebs repo: + +``` +git fetch ebs +git diff HEAD:hack/e2e ebs/master:hack/e2e > /tmp/hack_e2e.diff git apply --reject --directory hack/e2e /tmp/hack_e2e.diff git commit ``` From 01d09b0b546de5088bc44ac7047235e82d5ee8dc Mon Sep 17 00:00:00 2001 From: Nirmal Aagash Chandramohan Date: Fri, 16 Jul 2021 16:33:25 -0700 Subject: [PATCH 59/59] Updated README.md and changes to version in snapshot example --- .gitignore | 5 ++++- docs/README.md | 9 ++------- examples/kubernetes/dynamic-provisioning/README.md | 2 +- .../kubernetes/snapshot/specs/classes/snapshotclass.yaml | 2 +- .../kubernetes/snapshot/specs/snapshot-import/README.md | 2 +- .../static-snapshot/volume-snapshot-content.yaml | 2 +- .../snapshot-import/static-snapshot/volume-snapshot.yaml | 2 +- .../kubernetes/snapshot/specs/snapshot/snapshot.yaml | 2 +- 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 647acc1433..d502c8a9f5 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,7 @@ Vagrantfile *.swp # IntelliJ -.idea/ \ No newline at end of file +.idea/ + +#MacOS system files +*.DS_Store \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 2531f9640a..491b175d21 100644 --- a/docs/README.md +++ b/docs/README.md @@ -147,14 +147,9 @@ By default, driver tolerates taint `CriticalAddonsOnly` and has `tolerationSecon #### Deploy driver Please see the compatibility matrix above before you deploy the driver -If you want to deploy the stable driver without alpha features: +To deploy the CSI driver: ```sh -kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=release-0.10" -``` - -If you want to deploy the driver with alpha features: -```sh -kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/alpha/?ref=master" +kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=release-1.1" ``` Verify driver is running: diff --git a/examples/kubernetes/dynamic-provisioning/README.md b/examples/kubernetes/dynamic-provisioning/README.md index 179af5ab37..afced29391 100644 --- a/examples/kubernetes/dynamic-provisioning/README.md +++ b/examples/kubernetes/dynamic-provisioning/README.md @@ -5,7 +5,7 @@ This example shows how to create a EBS volume and consume it from container dyna 1. Kubernetes 1.13+ (CSI 1.0). -2. The [aws-ebs-csi-driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver) is installed with `--set enableVolumeScheduling=true`. +2. The [aws-ebs-csi-driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver) is installed. ## Usage diff --git a/examples/kubernetes/snapshot/specs/classes/snapshotclass.yaml b/examples/kubernetes/snapshot/specs/classes/snapshotclass.yaml index c3670ef4b8..2d15c9849b 100644 --- a/examples/kubernetes/snapshot/specs/classes/snapshotclass.yaml +++ b/examples/kubernetes/snapshot/specs/classes/snapshotclass.yaml @@ -1,4 +1,4 @@ -apiVersion: snapshot.storage.k8s.io/v1beta1 +apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotClass metadata: name: csi-aws-vsc diff --git a/examples/kubernetes/snapshot/specs/snapshot-import/README.md b/examples/kubernetes/snapshot/specs/snapshot-import/README.md index 41e7950f26..9d2800e16e 100644 --- a/examples/kubernetes/snapshot/specs/snapshot-import/README.md +++ b/examples/kubernetes/snapshot/specs/snapshot-import/README.md @@ -23,7 +23,7 @@ volumes using the `VolumeSnapshot` custom resources. snapshot in us-west-2b availability zone. ``` -apiVersion: snapshot.storage.k8s.io/v1beta1 +apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotContent metadata: name: static-snapshot-content diff --git a/examples/kubernetes/snapshot/specs/snapshot-import/static-snapshot/volume-snapshot-content.yaml b/examples/kubernetes/snapshot/specs/snapshot-import/static-snapshot/volume-snapshot-content.yaml index c284cbab8a..4d507847da 100644 --- a/examples/kubernetes/snapshot/specs/snapshot-import/static-snapshot/volume-snapshot-content.yaml +++ b/examples/kubernetes/snapshot/specs/snapshot-import/static-snapshot/volume-snapshot-content.yaml @@ -1,4 +1,4 @@ -apiVersion: snapshot.storage.k8s.io/v1beta1 +apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotContent metadata: name: static-snapshot-content diff --git a/examples/kubernetes/snapshot/specs/snapshot-import/static-snapshot/volume-snapshot.yaml b/examples/kubernetes/snapshot/specs/snapshot-import/static-snapshot/volume-snapshot.yaml index d23597b6a9..0bf9e59163 100644 --- a/examples/kubernetes/snapshot/specs/snapshot-import/static-snapshot/volume-snapshot.yaml +++ b/examples/kubernetes/snapshot/specs/snapshot-import/static-snapshot/volume-snapshot.yaml @@ -1,4 +1,4 @@ -apiVersion: snapshot.storage.k8s.io/v1beta1 +apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshot metadata: name: static-snapshot-demo diff --git a/examples/kubernetes/snapshot/specs/snapshot/snapshot.yaml b/examples/kubernetes/snapshot/specs/snapshot/snapshot.yaml index b0ea9e027c..6806a5ed5a 100644 --- a/examples/kubernetes/snapshot/specs/snapshot/snapshot.yaml +++ b/examples/kubernetes/snapshot/specs/snapshot/snapshot.yaml @@ -1,4 +1,4 @@ -apiVersion: snapshot.storage.k8s.io/v1beta1 +apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshot metadata: name: ebs-volume-snapshot