Add ReadFrom,WriteTo helpers for server config (#8580)

This commit is contained in:
Harshavardhana
2019-11-27 09:36:08 -08:00
committed by GitHub
parent 87443af49e
commit 30e80d0a86
4 changed files with 285 additions and 247 deletions

View File

@@ -151,6 +151,11 @@ func readServerConfig(ctx context.Context, objAPI ObjectLayer) (config.Config, e
configFile := path.Join(minioConfigPrefix, minioConfigFile)
configData, err := readConfig(ctx, objAPI, configFile)
if err != nil {
// Config not found for some reason, allow things to continue
// by initializing a new fresh config in safe mode.
if err == errConfigNotFound && globalSafeMode {
return newServerConfig(), nil
}
return nil, err
}