mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-29 17:50:23 +00:00
cleanup: return error type in lookupRBDImageMetadataStash()
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
8e589587ae
commit
f262673b60
@ -1117,7 +1117,7 @@ func lookupRBDImageMetadataStash(path string) (rbdImageMetadataStash, error) {
|
|||||||
encodedBytes, err := ioutil.ReadFile(fPath) // #nosec - intended reading from fPath
|
encodedBytes, err := ioutil.ReadFile(fPath) // #nosec - intended reading from fPath
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !os.IsNotExist(err) {
|
if !os.IsNotExist(err) {
|
||||||
return imgMeta, fmt.Errorf("failed to read stashed JSON image metadata from path (%s): (%v)", fPath, err)
|
return imgMeta, fmt.Errorf("failed to read stashed JSON image metadata from path (%s): %w", fPath, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return imgMeta, util.JoinErrors(ErrMissingStash, err)
|
return imgMeta, util.JoinErrors(ErrMissingStash, err)
|
||||||
@ -1125,7 +1125,7 @@ func lookupRBDImageMetadataStash(path string) (rbdImageMetadataStash, error) {
|
|||||||
|
|
||||||
err = json.Unmarshal(encodedBytes, &imgMeta)
|
err = json.Unmarshal(encodedBytes, &imgMeta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return imgMeta, fmt.Errorf("failed to unmarshall stashed JSON image metadata from path (%s): (%v)", fPath, err)
|
return imgMeta, fmt.Errorf("failed to unmarshall stashed JSON image metadata from path (%s): %w", fPath, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return imgMeta, nil
|
return imgMeta, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user