aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-03-18 00:36:22 -0700
committerchrislu <chris.lu@gmail.com>2022-03-18 00:36:22 -0700
commit498a0af0ee54b2c06dd0710cf6fd84722ea75912 (patch)
tree8bc7f6e02eb1fcfb4ee4f6c4ccf522be3d69f45f
parent269595f398722c93a01b27187ee71fc37fbf7c37 (diff)
downloadseaweedfs-csi-driver-498a0af0ee54b2c06dd0710cf6fd84722ea75912.tar.xz
seaweedfs-csi-driver-498a0af0ee54b2c06dd0710cf6fd84722ea75912.zip
set disk type from either volumeAttributes or request parametersv1.0.8
related to https://github.com/seaweedfs/seaweedfs-csi-driver/issues/50
-rw-r--r--README.md2
-rw-r--r--pkg/driver/nodeserver.go4
2 files changed, 6 insertions, 0 deletions
diff --git a/README.md b/README.md
index 2597a0d..fb30c2d 100644
--- a/README.md
+++ b/README.md
@@ -94,6 +94,7 @@ provisioner: seaweedfs-csi-driver
parameters:
collection: mycollection
replication: "011"
+ diskType: "ssd"
```
There is another use case when we need to access one folder from different pods with ro/rw access.
@@ -116,6 +117,7 @@ spec:
collection: default
replication: "011"
path: /path/to/files
+ diskType: "ssd"
readOnly: true
persistentVolumeReclaimPolicy: Retain
volumeMode: Filesystem
diff --git a/pkg/driver/nodeserver.go b/pkg/driver/nodeserver.go
index 8d2277a..968f5e4 100644
--- a/pkg/driver/nodeserver.go
+++ b/pkg/driver/nodeserver.go
@@ -63,6 +63,10 @@ func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
collection = volumeID
}
+ if diskType, ok := volContext["diskType"]; ok {
+ ns.Driver.DiskType = diskType
+ }
+
mounter, err := newMounter(path, collection, req.GetReadonly(), ns.Driver, volContext)
if err != nil {
return nil, err