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:
Harshavardhana
2018-08-22 23:11:17 -07:00
committed by GitHub
parent 8601f29d95
commit b01e69e08f
4 changed files with 13 additions and 21 deletions

View File

@@ -174,10 +174,6 @@ func TestServerConfigMigrateV2toV28(t *testing.T) {
}
defer os.RemoveAll(fsDir)
globalObjLayerMutex.Lock()
globalObjectAPI = objLayer
globalObjLayerMutex.Unlock()
configPath := rootPath + "/" + minioConfigFile
// Create a corrupted config file
@@ -203,12 +199,12 @@ func TestServerConfigMigrateV2toV28(t *testing.T) {
t.Fatal("Unexpected error: ", err)
}
if err := migrateConfigToMinioSys(); err != nil {
if err := migrateConfigToMinioSys(objLayer); err != nil {
t.Fatal("Unexpected error: ", err)
}
// Initialize server config and check again if everything is fine
if err := loadConfig(newObjectLayerFn()); err != nil {
if err := loadConfig(objLayer); err != nil {
t.Fatalf("Unable to initialize from updated config file %s", err)
}