mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
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:
committed by
mergify[bot]
parent
6961b103b8
commit
a362ef6bd4
@ -17,13 +17,12 @@ limitations under the License.
|
||||
package core
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
cerrors "github.com/ceph/ceph-csi/internal/cephfs/errors"
|
||||
|
||||
fsa "github.com/ceph/go-ceph/cephfs/admin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCloneStateToError(t *testing.T) {
|
||||
@ -36,6 +35,6 @@ func TestCloneStateToError(t *testing.T) {
|
||||
errorState[cephFSCloneState{fsa.CloneFailed, "", ""}] = cerrors.ErrCloneFailed
|
||||
|
||||
for state, err := range errorState {
|
||||
assert.True(t, errors.Is(state.ToError(), err))
|
||||
require.ErrorIs(t, state.ToError(), err)
|
||||
}
|
||||
}
|
||||
|
@ -29,11 +29,11 @@ import (
|
||||
// that interacts with CephFS filesystem API's.
|
||||
type FileSystem interface {
|
||||
// GetFscID returns the ID of the filesystem with the given name.
|
||||
GetFscID(context.Context, string) (int64, error)
|
||||
GetFscID(ctx context.Context, fsName string) (int64, error)
|
||||
// GetMetadataPool returns the metadata pool name of the filesystem with the given name.
|
||||
GetMetadataPool(context.Context, string) (string, error)
|
||||
GetMetadataPool(ctx context.Context, fsName string) (string, error)
|
||||
// GetFsName returns the name of the filesystem with the given ID.
|
||||
GetFsName(context.Context, int64) (string, error)
|
||||
GetFsName(ctx context.Context, fsID int64) (string, error)
|
||||
}
|
||||
|
||||
// fileSystem is the implementation of FileSystem interface.
|
||||
|
Reference in New Issue
Block a user