aboutsummaryrefslogtreecommitdiff
path: root/pkg/driver/nodeserver.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2023-04-26 20:47:47 -0700
committerGitHub <noreply@github.com>2023-04-26 20:47:47 -0700
commitd777b8750bb2dd33948988f4eec8813e6207a0cd (patch)
tree557827d3ed02ea22c45c7cdccb6990cde7507f34 /pkg/driver/nodeserver.go
parent3b656266b0da5457668b002ae6146b5d0976e781 (diff)
parent63378de0eda4d84ce1326afa057b2868a71306b3 (diff)
downloadseaweedfs-csi-driver-1.1.7.tar.xz
seaweedfs-csi-driver-1.1.7.zip
Merge pull request #117 from washcycle/washcycle/issue115v1.1.8v1.1.7
Validations to Pass CSI Sanity Tests and Script
Diffstat (limited to 'pkg/driver/nodeserver.go')
-rw-r--r--pkg/driver/nodeserver.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/pkg/driver/nodeserver.go b/pkg/driver/nodeserver.go
index 3f18202..87fe6c5 100644
--- a/pkg/driver/nodeserver.go
+++ b/pkg/driver/nodeserver.go
@@ -9,7 +9,6 @@ import (
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/seaweedfs/seaweedfs/weed/glog"
"google.golang.org/grpc/codes"
- _ "google.golang.org/grpc/resolver/passthrough"
"google.golang.org/grpc/status"
"k8s.io/utils/mount"
)
@@ -238,7 +237,20 @@ func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag
}
func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
+
volumeID := req.GetVolumeId()
+ if len(volumeID) == 0 {
+ return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request")
+ }
+
+ volumePath := req.GetVolumePath()
+ if len(volumePath) == 0 {
+ return nil, status.Error(codes.InvalidArgument, "Volume path missing in request")
+ }
+
+ // TODO Check if volume exists
+ // TODO Check if node exists
+
requiredBytes := req.GetCapacityRange().GetRequiredBytes()
glog.V(0).Infof("Node expand volume %s to %d bytes", volumeID, requiredBytes)