object: fix rgw ceph config

use Zone and ZoneGroup instead of storename for rgw_zone and rgw_zonegroup

Signed-off-by: Olivier Bouffet <olivier.bouffet@infomaniak.com>
(cherry picked from commit c92270cd66)
This commit is contained in:
Olivier authored and Sébastien Han committed 2021-11-25 18:38:42 +01:00
1 parent 0dcfefa3a1
commit 561cede1ef
2 files changed
+5 -5

No files matched your search

+4 -4
View File
@@ -110,16 +110,16 @@ func (c *clusterConfig) generateKeyring(rgwConfig *rgwConfig) (string, error) {
return keyring, s.CreateOrUpdate(rgwConfig.ResourceName, keyring)
}
func (c *clusterConfig) setDefaultFlagsMonConfigStore(rgwName string) error {
func (c *clusterConfig) setDefaultFlagsMonConfigStore(rgwConfig *rgwConfig) error {
monStore := cephconfig.GetMonStore(c.context, c.clusterInfo)
who := generateCephXUser(rgwName)
who := generateCephXUser(rgwConfig.ResourceName)
configOptions := make(map[string]string)
configOptions["rgw_log_nonexistent_bucket"] = "true"
configOptions["rgw_log_object_name_utc"] = "true"
configOptions["rgw_enable_usage_log"] = "true"
configOptions["rgw_zone"] = c.store.Name
configOptions["rgw_zonegroup"] = c.store.Name
configOptions["rgw_zone"] = rgwConfig.Zone
configOptions["rgw_zonegroup"] = rgwConfig.ZoneGroup
for flag, val := range configOptions {
err := monStore.Set(who, flag, val)
+1 -1
View File
@@ -127,7 +127,7 @@ func (c *clusterConfig) startRGWPods(realmName, zoneGroupName, zoneName string)
// Unfortunately, on upgrade we would not set the flags which is not ideal for old clusters where we were no setting those flags
// The KV supports setting those flags even if the RGW is running
logger.Info("setting rgw config flags")
err = c.setDefaultFlagsMonConfigStore(rgwConfig.ResourceName)
err = c.setDefaultFlagsMonConfigStore(rgwConfig)
if err != nil {
// Getting EPERM typically happens when the flag may not be modified at runtime
// This is fine to ignore