mirror of
https://github.com/minio/minio.git
synced 2025-01-27 06:33:18 -05:00
parent
5549a44566
commit
d6af3c1237
@ -196,6 +196,15 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
|||||||
// Add API router.
|
// Add API router.
|
||||||
registerAPIRouter(router)
|
registerAPIRouter(router)
|
||||||
|
|
||||||
|
// Dummy endpoint representing gateway instance.
|
||||||
|
globalEndpoints = []Endpoint{{
|
||||||
|
URL: &url.URL{Path: "/minio/gateway"},
|
||||||
|
IsLocal: true,
|
||||||
|
}}
|
||||||
|
|
||||||
|
// Initialize Admin Peers.
|
||||||
|
initGlobalAdminPeers(globalEndpoints)
|
||||||
|
|
||||||
var getCert certs.GetCertificateFunc
|
var getCert certs.GetCertificateFunc
|
||||||
if globalTLSCerts != nil {
|
if globalTLSCerts != nil {
|
||||||
getCert = globalTLSCerts.GetCertificate
|
getCert = globalTLSCerts.GetCertificate
|
||||||
@ -221,7 +230,10 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
|||||||
|
|
||||||
// Create a new config system.
|
// Create a new config system.
|
||||||
globalConfigSys = NewConfigSys()
|
globalConfigSys = NewConfigSys()
|
||||||
|
if globalEtcdClient != nil {
|
||||||
|
// Initialize server config.
|
||||||
|
_ = globalConfigSys.Init(newObject)
|
||||||
|
} else {
|
||||||
// Initialize server config.
|
// Initialize server config.
|
||||||
srvCfg := newServerConfig()
|
srvCfg := newServerConfig()
|
||||||
|
|
||||||
@ -235,6 +247,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
|||||||
globalServerConfigMu.Lock()
|
globalServerConfigMu.Lock()
|
||||||
globalServerConfig = srvCfg
|
globalServerConfig = srvCfg
|
||||||
globalServerConfigMu.Unlock()
|
globalServerConfigMu.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
// Load logger subsystem
|
// Load logger subsystem
|
||||||
loadLoggers()
|
loadLoggers()
|
||||||
@ -257,7 +270,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
|||||||
globalIAMSys = NewIAMSys()
|
globalIAMSys = NewIAMSys()
|
||||||
if globalEtcdClient != nil {
|
if globalEtcdClient != nil {
|
||||||
// Initialize IAM sys.
|
// Initialize IAM sys.
|
||||||
go globalIAMSys.Init(newObject)
|
_ = globalIAMSys.Init(newObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new policy system.
|
// Create new policy system.
|
||||||
@ -268,6 +281,9 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
|||||||
|
|
||||||
// Create new notification system.
|
// Create new notification system.
|
||||||
globalNotificationSys = NewNotificationSys(globalServerConfig, globalEndpoints)
|
globalNotificationSys = NewNotificationSys(globalServerConfig, globalEndpoints)
|
||||||
|
if globalEtcdClient != nil {
|
||||||
|
_ = globalNotificationSys.Init(newObject)
|
||||||
|
}
|
||||||
|
|
||||||
// Once endpoints are finalized, initialize the new object api.
|
// Once endpoints are finalized, initialize the new object api.
|
||||||
globalObjLayerMutex.Lock()
|
globalObjLayerMutex.Lock()
|
||||||
|
@ -61,6 +61,7 @@ func printGatewayCommonMsg(apiEndpoints []string) {
|
|||||||
logger.StartupMessage(colorBlue("AccessKey: ") + colorBold(fmt.Sprintf("%s ", cred.AccessKey)))
|
logger.StartupMessage(colorBlue("AccessKey: ") + colorBold(fmt.Sprintf("%s ", cred.AccessKey)))
|
||||||
logger.StartupMessage(colorBlue("SecretKey: ") + colorBold(fmt.Sprintf("%s ", cred.SecretKey)))
|
logger.StartupMessage(colorBlue("SecretKey: ") + colorBold(fmt.Sprintf("%s ", cred.SecretKey)))
|
||||||
}
|
}
|
||||||
|
printEventNotifiers()
|
||||||
|
|
||||||
if globalIsBrowserEnabled {
|
if globalIsBrowserEnabled {
|
||||||
logger.StartupMessage(colorBlue("\nBrowser Access:"))
|
logger.StartupMessage(colorBlue("\nBrowser Access:"))
|
||||||
|
@ -108,7 +108,7 @@ func (g *NAS) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &nasObjects{newObject.(*minio.FSObjects)}, nil
|
return &nasObjects{newObject}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Production - nas gateway is production ready.
|
// Production - nas gateway is production ready.
|
||||||
@ -118,15 +118,5 @@ func (g *NAS) Production() bool {
|
|||||||
|
|
||||||
// nasObjects implements gateway for Minio and S3 compatible object storage servers.
|
// nasObjects implements gateway for Minio and S3 compatible object storage servers.
|
||||||
type nasObjects struct {
|
type nasObjects struct {
|
||||||
*minio.FSObjects
|
minio.ObjectLayer
|
||||||
}
|
|
||||||
|
|
||||||
// IsNotificationSupported returns whether notifications are applicable for this layer.
|
|
||||||
func (l *nasObjects) IsNotificationSupported() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsCompressionSupported returns whether compression is applicable for this layer.
|
|
||||||
func (l *nasObjects) IsCompressionSupported() bool {
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,9 @@ const (
|
|||||||
|
|
||||||
// DistXLSetupType - Distributed XL setup type enum.
|
// DistXLSetupType - Distributed XL setup type enum.
|
||||||
DistXLSetupType
|
DistXLSetupType
|
||||||
|
|
||||||
|
// GatewaySetupType - gateway setup type enum.
|
||||||
|
GatewaySetupType
|
||||||
)
|
)
|
||||||
|
|
||||||
func (setupType SetupType) String() string {
|
func (setupType SetupType) String() string {
|
||||||
@ -38,6 +41,8 @@ func (setupType SetupType) String() string {
|
|||||||
return globalMinioModeXL
|
return globalMinioModeXL
|
||||||
case DistXLSetupType:
|
case DistXLSetupType:
|
||||||
return globalMinioModeDistXL
|
return globalMinioModeDistXL
|
||||||
|
case GatewaySetupType:
|
||||||
|
return globalMinioModeGatewayPrefix
|
||||||
}
|
}
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user