mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
cleanup: resolves gocritic linter issues
This commit resolves gocritic linter errors. Updates: #2250 Signed-off-by: Yati Padia <ypadia@redhat.com>
This commit is contained in:
parent
dd0884310f
commit
ffab37f44f
@ -621,7 +621,7 @@ var _ = Describe("RBD", func() {
|
||||
|
||||
// Prepare the rbd-nbd with command args
|
||||
attachCmd := strings.ReplaceAll(mapCmd, "map", "attach --device /dev/nbd0")
|
||||
m1 := regexp.MustCompile(`/keyfile-[0-9]* `)
|
||||
m1 := regexp.MustCompile(`/keyfile-\d* `)
|
||||
attachCmd = m1.ReplaceAllString(attachCmd, "/keyfile-test ")
|
||||
e2elog.Logf("attach command to run after restart, attachCmd: %v", attachCmd)
|
||||
|
||||
|
@ -575,7 +575,7 @@ func (ns *NodeServer) createTargetMountPath(ctx context.Context, mountPath strin
|
||||
// Check if that mount path exists properly
|
||||
notMnt, err := mount.IsNotMountPoint(ns.mounter, mountPath)
|
||||
if err == nil {
|
||||
return notMnt, err
|
||||
return notMnt, nil
|
||||
}
|
||||
if !os.IsNotExist(err) {
|
||||
return false, status.Error(codes.Internal, err.Error())
|
||||
|
@ -165,7 +165,7 @@ func getSchedulingDetails(parameters map[string]string) (admin.Interval, admin.S
|
||||
// validateSchedulingInterval return the interval as it is if its ending with
|
||||
// `m|h|d` or else it will return error.
|
||||
func validateSchedulingInterval(interval string) (admin.Interval, error) {
|
||||
var re = regexp.MustCompile(`^[0-9]+[mhd]$`)
|
||||
var re = regexp.MustCompile(`^\d+[mhd]$`)
|
||||
if re.MatchString(interval) {
|
||||
return admin.Interval(interval), nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user