mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
build: address errorlint
warning
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
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)
|
||||
}
|
||||
|
@ -567,7 +567,7 @@ func RegenerateJournal(
|
||||
|
||||
err = vi.DecomposeCSIID(rbdVol.VolID)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%w: error decoding volume ID (%s) (%s)",
|
||||
return "", fmt.Errorf("%w: error decoding volume ID (%w) (%s)",
|
||||
ErrInvalidVolID, err, rbdVol.VolID)
|
||||
}
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ func GenVolFromVolID(
|
||||
|
||||
err := vi.DecomposeCSIID(volumeID)
|
||||
if err != nil {
|
||||
return vol, fmt.Errorf("%w: error decoding volume ID (%s) (%s)",
|
||||
return vol, fmt.Errorf("%w: error decoding volume ID (%w) (%s)",
|
||||
ErrInvalidVolID, err, volumeID)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user