mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
build: address errorlint
warning
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
3a43fb84f8
commit
b9b8392f71
@ -270,14 +270,14 @@ func (nv *NFSVolume) getNFSCluster() (string, error) {
|
||||
fs := fscore.NewFileSystem(nv.conn)
|
||||
fsName, err := fs.GetFsName(nv.ctx, nv.fscID)
|
||||
if err != nil && errors.Is(err, util.ErrPoolNotFound) {
|
||||
return "", fmt.Errorf("%w for ID %x: %v", ErrFilesystemNotFound, nv.fscID, err)
|
||||
return "", fmt.Errorf("%w for ID %x: %w", ErrFilesystemNotFound, nv.fscID, err)
|
||||
} else if err != nil {
|
||||
return "", fmt.Errorf("failed to get filesystem name for ID %x: %w", nv.fscID, err)
|
||||
}
|
||||
|
||||
mdPool, err := fs.GetMetadataPool(nv.ctx, fsName)
|
||||
if err != nil && errors.Is(err, util.ErrPoolNotFound) {
|
||||
return "", fmt.Errorf("metadata pool for %q %w: %v", fsName, ErrNotFound, err)
|
||||
return "", fmt.Errorf("metadata pool for %q %w: %w", fsName, ErrNotFound, err)
|
||||
} else if err != nil {
|
||||
return "", fmt.Errorf("failed to get metadata pool for %q: %w", fsName, err)
|
||||
}
|
||||
@ -291,7 +291,7 @@ func (nv *NFSVolume) getNFSCluster() (string, error) {
|
||||
|
||||
clusterName, err := j.FetchAttribute(nv.ctx, mdPool, nv.objectUUID, clusterNameKey)
|
||||
if err != nil && errors.Is(err, util.ErrPoolNotFound) || errors.Is(err, util.ErrKeyNotFound) {
|
||||
return "", fmt.Errorf("cluster name for %q %w: %v", nv.objectUUID, ErrNotFound, err)
|
||||
return "", fmt.Errorf("cluster name for %q %w: %w", nv.objectUUID, ErrNotFound, err)
|
||||
} else if err != nil {
|
||||
return "", fmt.Errorf("failed to get cluster name for %q: %w", nv.objectUUID, err)
|
||||
}
|
||||
@ -308,14 +308,14 @@ func (nv *NFSVolume) setNFSCluster(clusterName string) error {
|
||||
fs := fscore.NewFileSystem(nv.conn)
|
||||
fsName, err := fs.GetFsName(nv.ctx, nv.fscID)
|
||||
if err != nil && errors.Is(err, util.ErrPoolNotFound) {
|
||||
return fmt.Errorf("%w for ID %x: %v", ErrFilesystemNotFound, nv.fscID, err)
|
||||
return fmt.Errorf("%w for ID %x: %w", ErrFilesystemNotFound, nv.fscID, err)
|
||||
} else if err != nil {
|
||||
return fmt.Errorf("failed to get filesystem name for ID %x: %w", nv.fscID, err)
|
||||
}
|
||||
|
||||
mdPool, err := fs.GetMetadataPool(nv.ctx, fsName)
|
||||
if err != nil && errors.Is(err, util.ErrPoolNotFound) {
|
||||
return fmt.Errorf("metadata pool for %q %w: %v", fsName, ErrNotFound, err)
|
||||
return fmt.Errorf("metadata pool for %q %w: %w", fsName, ErrNotFound, err)
|
||||
} else if err != nil {
|
||||
return fmt.Errorf("failed to get metadata pool for %q: %w", fsName, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user