mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
cleanup: return error type in stashRBDImageMetadata()
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
57ce07f54e
commit
8e589587ae
@ -1097,13 +1097,13 @@ func stashRBDImageMetadata(volOptions *rbdVolume, path string) error {
|
|||||||
|
|
||||||
encodedBytes, err := json.Marshal(imgMeta)
|
encodedBytes, err := json.Marshal(imgMeta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to marshall JSON image metadata for image (%s): (%v)", volOptions, err)
|
return fmt.Errorf("failed to marshall JSON image metadata for image (%s): %w", volOptions, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fPath := filepath.Join(path, stashFileName)
|
fPath := filepath.Join(path, stashFileName)
|
||||||
err = ioutil.WriteFile(fPath, encodedBytes, 0600)
|
err = ioutil.WriteFile(fPath, encodedBytes, 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to stash JSON image metadata for image (%s) at path (%s): (%v)", volOptions, fPath, err)
|
return fmt.Errorf("failed to stash JSON image metadata for image (%s) at path (%s): %w", volOptions, fPath, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user