Merge pull request #408 from humblec/validate-paths

Add staging target path validation to nodeserver
This commit is contained in:
Humble Devassy Chirammal 2019-06-07 11:37:37 +05:30 committed by GitHub
commit e16f246f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -177,6 +177,10 @@ func validateNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) error {
return errors.New("target path missing in request") return errors.New("target path missing in request")
} }
if req.GetStagingTargetPath() == "" {
return errors.New("staging target path missing in request")
}
return nil return nil
} }

View File

@ -41,9 +41,6 @@ type NodeServer struct {
mounter mount.Interface mounter mount.Interface
} }
//TODO remove both stage and unstage methods
//once https://github.com/kubernetes-csi/drivers/pull/145 is merged
// NodePublishVolume mounts the volume mounted to the device path to the target // NodePublishVolume mounts the volume mounted to the device path to the target
// path // path
func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) { func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {