mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-18 04:10:22 +00:00
skip redundant error check
correct misspelled word Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This commit is contained in:
parent
49f5d4a54e
commit
6fbde110cd
@ -87,13 +87,10 @@ func execCommand(program string, args ...string) (stdout, stderr []byte, err err
|
||||
}
|
||||
|
||||
func execCommandErr(program string, args ...string) error {
|
||||
if _, _, err := execCommand(program, args...); err != nil {
|
||||
_, _, err := execCommand(program, args...)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func execCommandJSON(v interface{}, program string, args ...string) error {
|
||||
stdout, _, err := execCommand(program, args...)
|
||||
if err != nil {
|
||||
@ -119,10 +116,7 @@ func isMountPoint(p string) (bool, error) {
|
||||
return !notMnt, nil
|
||||
}
|
||||
|
||||
//
|
||||
// Controller service request validation
|
||||
//
|
||||
|
||||
func (cs *ControllerServer) validateCreateVolumeRequest(req *csi.CreateVolumeRequest) error {
|
||||
if err := cs.Driver.ValidateControllerServiceRequest(csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME); err != nil {
|
||||
return fmt.Errorf("invalid CreateVolumeRequest: %v", err)
|
||||
@ -154,10 +148,7 @@ func (cs *ControllerServer) validateDeleteVolumeRequest() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//
|
||||
// Node service request validation
|
||||
//
|
||||
|
||||
func validateNodeStageVolumeRequest(req *csi.NodeStageVolumeRequest) error {
|
||||
if req.GetVolumeCapability() == nil {
|
||||
return errors.New("volume capability missing in request")
|
||||
@ -200,7 +191,7 @@ func validateNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) error {
|
||||
}
|
||||
|
||||
if req.GetTargetPath() == "" {
|
||||
return errors.New("varget path missing in request")
|
||||
return errors.New("target path missing in request")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user