Return proper errors when admin API is not initialized (#6988)

Especially in gateway IAM admin APIs are not enabled
if etcd is not enabled, we should enable admin API though
but only enable IAM and Config APIs with etcd configured.
This commit is contained in:
Harshavardhana
2018-12-18 13:03:26 -08:00
committed by GitHub
parent 5a5895203b
commit e7c902bbbc
5 changed files with 48 additions and 36 deletions

View File

@@ -173,11 +173,12 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
if globalEtcdClient != nil {
// Enable STS router if etcd is enabled.
registerSTSRouter(router)
// Enable admin router if etcd is enabled.
registerAdminRouter(router)
}
// Enable IAM admin APIs if etcd is enabled, if not just enable basic
// operations such as profiling, server info etc.
registerAdminRouter(router, globalEtcdClient != nil)
// Add healthcheck router
registerHealthCheckRouter(router)
@@ -307,5 +308,8 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
printGatewayStartupMessage(getAPIEndpoints(), gatewayName)
}
// Set uptime time after object layer has initialized.
globalBootTime = UTCNow()
handleSignals()
}