File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -103,11 +103,16 @@ func (s *service) NodePublishVolume(
103
103
req * csi.NodePublishVolumeRequest ) (
104
104
* csi.NodePublishVolumeResponse , error ) {
105
105
106
- device , ok := req .PublishInfo ["device" ]
107
- if ! ok {
108
- return nil , status .Error (
109
- codes .InvalidArgument ,
110
- "publish volume info 'device' key required" )
106
+ if len (req .GetVolumeId ()) == 0 {
107
+ return nil , status .Error (codes .InvalidArgument , "Volume ID cannot be empty" )
108
+ }
109
+
110
+ if len (req .GetTargetPath ()) == 0 {
111
+ return nil , status .Error (codes .InvalidArgument , "Target Path cannot be empty" )
112
+ }
113
+
114
+ if req .GetVolumeCapability () == nil {
115
+ return nil , status .Error (codes .InvalidArgument , "Volume Capability cannot be empty" )
111
116
}
112
117
113
118
s .volsRWL .Lock ()
@@ -135,7 +140,7 @@ func (s *service) NodePublishVolume(
135
140
}
136
141
137
142
// Publish the volume.
138
- v .Attributes [nodeMntPathKey ] = device
143
+ v .Attributes [nodeMntPathKey ] = req . GetStagingTargetPath ()
139
144
s .vols [i ] = v
140
145
141
146
return & csi.NodePublishVolumeResponse {}, nil
You can’t perform that action at this time.
0 commit comments