From db4a16fd10f508be7406cd91f09c731d2c90b346 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Wed, 7 Dec 2022 14:16:04 -0700 Subject: [PATCH] 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 (cherry picked from commit 9975e094060a8af66c9e07b00e6d599b2f996860) --- pkg/daemon/ceph/client/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/daemon/ceph/client/config.go b/pkg/daemon/ceph/client/config.go index 5295230d8..4f531e51c 100644 --- a/pkg/daemon/ceph/client/config.go +++ b/pkg/daemon/ceph/client/config.go @@ -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()) }