mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
Initialize global object layer after all subsystems have initialized (#6333)
This is to ensure that object API operations are not performed on a server on which subsystems are yet to be initialized.
This commit is contained in:
@@ -202,9 +202,9 @@ func NewConfigSys() *ConfigSys {
|
||||
}
|
||||
|
||||
// Migrates ${HOME}/.minio/config.json to '<export_path>/.minio.sys/config/config.json'
|
||||
func migrateConfigToMinioSys() error {
|
||||
func migrateConfigToMinioSys(objAPI ObjectLayer) error {
|
||||
// Verify if backend already has the file.
|
||||
if err := checkServerConfig(context.Background(), newObjectLayerFn()); err != errConfigNotFound {
|
||||
if err := checkServerConfig(context.Background(), objAPI); err != errConfigNotFound {
|
||||
return err
|
||||
} // if errConfigNotFound proceed to migrate..
|
||||
|
||||
@@ -213,7 +213,7 @@ func migrateConfigToMinioSys() error {
|
||||
return err
|
||||
}
|
||||
|
||||
return saveServerConfig(newObjectLayerFn(), config)
|
||||
return saveServerConfig(objAPI, config)
|
||||
}
|
||||
|
||||
// Initialize and load config from remote etcd or local config directory
|
||||
@@ -236,7 +236,7 @@ func initConfig(objAPI ObjectLayer) error {
|
||||
}
|
||||
|
||||
// Migrates ${HOME}/.minio/config.json to '<export_path>/.minio.sys/config/config.json'
|
||||
if err := migrateConfigToMinioSys(); err != nil {
|
||||
if err := migrateConfigToMinioSys(objAPI); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user