core: allow ceph.conf to be updated if already exist

The ceph.conf was being written with 0x444 permissions, which means
the file could not be updated if it already exists. Specifically, when
an osd is purged, if the operation is retried multiple times, only
the first operation was succeeding. The subsequent requests to purge
an osd were failing due to the config already existing. If we make
the config writeable with 0x644 then the operator can always write the file.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 9975e09406)
This commit is contained in:
Travis Nielsen authored and Satoru Takeuchi committed 2022-12-16 02:16:14 +00:00
1 parent 553379f91f
commit db4a16fd10
1 file changed
+1 -1
+1 -1
View File
@@ -293,7 +293,7 @@ func WriteCephConfig(context *clusterd.Context, clusterInfo *ClusterInfo) error
if err != nil {
return errors.Wrap(err, "failed to copy connection config to /etc/ceph. failed to read the connection config")
}
err = ioutil.WriteFile(DefaultConfigFilePath(), src, 0444)
err = ioutil.WriteFile(DefaultConfigFilePath(), src, 0600)
if err != nil {
return errors.Wrapf(err, "failed to copy connection config to /etc/ceph. failed to write %q", DefaultConfigFilePath())
}