mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cleanup: use os.WriteFile to write files
as ioutil.WriteFile is deprecated and suggestion is to use os.WriteFile as per https://pkg.go.dev/io/ioutil updating the same. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
15ed9709d4
commit
562dff0d19
@ -1625,7 +1625,7 @@ func stashRBDImageMetadata(volOptions *rbdVolume, metaDataPath string) error {
|
||||
}
|
||||
|
||||
fPath := filepath.Join(metaDataPath, stashFileName)
|
||||
err = ioutil.WriteFile(fPath, encodedBytes, 0o600)
|
||||
err = os.WriteFile(fPath, encodedBytes, 0o600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to stash JSON image metadata for image (%s) at path (%s): %w", volOptions, fPath, err)
|
||||
}
|
||||
@ -1673,7 +1673,7 @@ func updateRBDImageMetadataStash(metaDataPath, device string) error {
|
||||
}
|
||||
|
||||
fPath := filepath.Join(metaDataPath, stashFileName)
|
||||
err = ioutil.WriteFile(fPath, encodedBytes, 0600)
|
||||
err = os.WriteFile(fPath, encodedBytes, 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to stash JSON image metadata at path: (%s) for spec:(%s) : %w",
|
||||
fPath, imgMeta.String(), err)
|
||||
|
Reference in New Issue
Block a user