control: Fix controller CLI handling with distributed server object layer.

Object layer initialization is done lazily fix it.
This commit is contained in:
Harshavardhana
2016-08-18 14:50:50 -07:00
parent 8797952409
commit bb0466f4ce
10 changed files with 20 additions and 13 deletions

View File

@@ -106,16 +106,23 @@ func configureServerHandler(srvCmdConfig serverCmdConfig) http.Handler {
ObjectAPI: newObjectLayerFn,
}
// Initialize Controller.
ctrlHandlers := &controllerAPIHandlers{
ObjectAPI: newObjectLayerFn,
}
// Initialize router.
mux := router.NewRouter()
// Register all routers.
registerStorageRPCRouters(mux, storageRPCs)
// Initialize distributed NS lock.
initDistributedNSLock(mux, srvCmdConfig)
// FIXME: till net/rpc auth is brought in "minio control" can be enabled only though
// this env variable.
if os.Getenv("MINIO_CONTROL") != "" {
if !strings.EqualFold(os.Getenv("MINIO_CONTROL"), "off") {
registerControlRPCRouter(mux, ctrlHandlers)
}