cephfs: address golangci-lint issues

address golangci-lint issues in cephfs
related code.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2024-04-04 10:50:20 +02:00
committed by mergify[bot]
parent 6961b103b8
commit a362ef6bd4
11 changed files with 40 additions and 45 deletions

View File

@ -81,7 +81,7 @@ func (m *kernelMounter) mountKernel(
optionsStr := fmt.Sprintf("name=%s,secretfile=%s", cr.ID, cr.KeyFile)
mdsNamespace := ""
if volOptions.FsName != "" {
mdsNamespace = fmt.Sprintf("mds_namespace=%s", volOptions.FsName)
mdsNamespace = "mds_namespace=" + volOptions.FsName
}
optionsStr = util.MountOptionsAdd(optionsStr, mdsNamespace, volOptions.KernelMountOptions, netDev)

View File

@ -19,7 +19,7 @@ package mounter
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestFilesystemSupported(t *testing.T) {
@ -31,8 +31,8 @@ func TestFilesystemSupported(t *testing.T) {
// "proc" is always a supported filesystem, we detect supported
// filesystems by reading from it
assert.True(t, filesystemSupported("proc"))
require.True(t, filesystemSupported("proc"))
// "nonefs" is a made-up name, and does not exist
assert.False(t, filesystemSupported("nonefs"))
require.False(t, filesystemSupported("nonefs"))
}