diff --git a/cmd/s3-gw/app.go b/cmd/s3-gw/app.go index 6f1a9bc..ca4200f 100644 --- a/cmd/s3-gw/app.go +++ b/cmd/s3-gw/app.go @@ -12,7 +12,6 @@ import ( "os" "os/signal" "runtime/debug" - "strings" "sync" "syscall" "time" @@ -368,10 +367,6 @@ func (s *appSettings) IsDefaultNamespace(ns string) bool { } func (s *appSettings) setDefaultNamespaces(namespaces []string) { - for i := range namespaces { // to be set namespaces in env variable as `S3_GW_KLUDGE_DEFAULT_NAMESPACES="" "root"` - namespaces[i] = strings.Trim(namespaces[i], "\"") - } - s.mu.Lock() s.defaultNamespaces = namespaces s.mu.Unlock() diff --git a/cmd/s3-gw/app_settings.go b/cmd/s3-gw/app_settings.go index 3715e04..86a091c 100644 --- a/cmd/s3-gw/app_settings.go +++ b/cmd/s3-gw/app_settings.go @@ -481,6 +481,10 @@ func fetchDefaultNamespaces(l *zap.Logger, v *viper.Viper) []string { l.Warn(logs.DefaultNamespacesCannotBeEmpty, zap.Strings("namespaces", defaultNamespaces)) } + for i := range defaultNamespaces { // to be set namespaces in env variable as `S3_GW_KLUDGE_DEFAULT_NAMESPACES="" 'root'` + defaultNamespaces[i] = strings.Trim(defaultNamespaces[i], "\"'") + } + return defaultNamespaces }