diff --git a/pkg/cephfs/cephuser.go b/pkg/cephfs/cephuser.go index fda2a5e6b..48675e054 100644 --- a/pkg/cephfs/cephuser.go +++ b/pkg/cephfs/cephuser.go @@ -96,7 +96,7 @@ func createCephUser(volOptions *volumeOptions, adminCr *credentials, volID volum "osd", caps.Osd, } - if err := execCommandJSON(&ents, "ceph", args[:]...); err != nil { + if err := execCommandJSON(&ents, args[:]...); err != nil { return nil, fmt.Errorf("error creating ceph user: %v", err) } diff --git a/pkg/cephfs/controllerserver.go b/pkg/cephfs/controllerserver.go index 5584e4189..0bb027f31 100644 --- a/pkg/cephfs/controllerserver.go +++ b/pkg/cephfs/controllerserver.go @@ -103,7 +103,7 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol } func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error) { - if err := cs.validateDeleteVolumeRequest(req); err != nil { + if err := cs.validateDeleteVolumeRequest(); err != nil { glog.Errorf("DeleteVolumeRequest validation failed: %v", err) return nil, err } diff --git a/pkg/cephfs/util.go b/pkg/cephfs/util.go index f7a92bb95..7349b8984 100644 --- a/pkg/cephfs/util.go +++ b/pkg/cephfs/util.go @@ -53,7 +53,8 @@ func execCommandAndValidate(program string, args ...string) error { return nil } -func execCommandJSON(v interface{}, program string, args ...string) error { +func execCommandJSON(v interface{}, args ...string) error { + program := "ceph" out, err := execCommand(program, args...) if err != nil { @@ -126,7 +127,7 @@ func (cs *ControllerServer) validateCreateVolumeRequest(req *csi.CreateVolumeReq return nil } -func (cs *ControllerServer) validateDeleteVolumeRequest(req *csi.DeleteVolumeRequest) error { +func (cs *ControllerServer) validateDeleteVolumeRequest() error { if err := cs.Driver.ValidateControllerServiceRequest(csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME); err != nil { return fmt.Errorf("invalid DeleteVolumeRequest: %v", err) }