diff --git a/cmd/admin-handlers_test.go b/cmd/admin-handlers_test.go index 507f225aa..248b1c5aa 100644 --- a/cmd/admin-handlers_test.go +++ b/cmd/admin-handlers_test.go @@ -74,7 +74,7 @@ func prepareAdminErasureTestBed(ctx context.Context) (*adminErasureTestBed, erro globalEndpoints = mustGetPoolEndpoints(erasureDirs...) - newAllSubsystems() + initAllSubsystems() initConfigSubsystem(ctx, objLayer) diff --git a/cmd/auth-handler_test.go b/cmd/auth-handler_test.go index 247898551..f048c957a 100644 --- a/cmd/auth-handler_test.go +++ b/cmd/auth-handler_test.go @@ -362,7 +362,7 @@ func TestIsReqAuthenticated(t *testing.T) { t.Fatalf("unable initialize config file, %s", err) } - newAllSubsystems() + initAllSubsystems() ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -455,7 +455,7 @@ func TestValidateAdminSignature(t *testing.T) { t.Fatalf("unable initialize config file, %s", err) } - newAllSubsystems() + initAllSubsystems() initConfigSubsystem(ctx, objLayer) diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index df8a03259..fb7dd5a5e 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -291,7 +291,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) { newObject = NewGatewayLayerWithLocker(newObject) // Calls all New() for all sub-systems. - newAllSubsystems() + initAllSubsystems() // Once endpoints are finalized, initialize the new object api in safe mode. globalObjLayerMutex.Lock() @@ -307,7 +307,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) { } logger.FatalIf(globalBucketMetadataSys.Init(GlobalContext, buckets, newObject), "Unable to initialize bucket metadata") - logger.FatalIf(globalNotificationSys.Init(GlobalContext, newObject), "Unable to initialize notification system") + logger.FatalIf(globalNotificationSys.InitBucketTargets(GlobalContext, newObject), "Unable to initialize bucket targets for notification system") } if globalCacheConfig.Enabled { diff --git a/cmd/notification.go b/cmd/notification.go index c7648d810..e18f78e1b 100644 --- a/cmd/notification.go +++ b/cmd/notification.go @@ -673,8 +673,8 @@ func (sys *NotificationSys) set(bucket BucketInfo, meta BucketMetadata) { sys.AddRulesMap(bucket.Name, config.ToRulesMap()) } -// Init - initializes notification system from notification.xml and listenxl.meta of all buckets. -func (sys *NotificationSys) Init(ctx context.Context, objAPI ObjectLayer) error { +// InitBucketTargets - initializes notification system from notification.xml of all buckets. +func (sys *NotificationSys) InitBucketTargets(ctx context.Context, objAPI ObjectLayer) error { if objAPI == nil { return errServerNotInitialized } diff --git a/cmd/object-api-listobjects_test.go b/cmd/object-api-listobjects_test.go index 8e8e84b5a..a66abbfbc 100644 --- a/cmd/object-api-listobjects_test.go +++ b/cmd/object-api-listobjects_test.go @@ -1894,7 +1894,7 @@ func initFSObjectsB(disk string, t *testing.B) (obj ObjectLayer) { newTestConfig(globalMinioDefaultRegion, obj) - newAllSubsystems() + initAllSubsystems() return obj } diff --git a/cmd/server-main.go b/cmd/server-main.go index 7d2148fd9..bea75f459 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -216,7 +216,7 @@ func serverHandleEnvVars() { var globalHealStateLK sync.RWMutex -func newAllSubsystems() { +func initAllSubsystems() { if globalIsErasure { globalHealStateLK.Lock() // New global heal state @@ -225,7 +225,7 @@ func newAllSubsystems() { globalHealStateLK.Unlock() } - // Create new notification system and initialize notification targets + // Create new notification system and initialize notification peer targets globalNotificationSys = NewNotificationSys(globalEndpoints) // Create new bucket metadata system. @@ -421,7 +421,7 @@ func serverMain(ctx *cli.Context) { initHelp() // Initialize all sub-systems - newAllSubsystems() + initAllSubsystems() // Is distributed setup, error out if no certificates are found for HTTPS endpoints. if globalIsDistErasure { @@ -587,8 +587,8 @@ func serverMain(ctx *cli.Context) { // Initialize bucket metadata sub-system. globalBucketMetadataSys.Init(GlobalContext, buckets, newObject) - // Initialize bucket notification sub-system. - globalNotificationSys.Init(GlobalContext, newObject) + // Initialize bucket notification targets. + globalNotificationSys.InitBucketTargets(GlobalContext, newObject) // initialize the new disk cache objects. if globalCacheConfig.Enabled { diff --git a/cmd/signature-v4-utils_test.go b/cmd/signature-v4-utils_test.go index 1cd00841a..97a156eee 100644 --- a/cmd/signature-v4-utils_test.go +++ b/cmd/signature-v4-utils_test.go @@ -42,7 +42,7 @@ func TestCheckValid(t *testing.T) { t.Fatalf("unable initialize config file, %s", err) } - newAllSubsystems() + initAllSubsystems() initConfigSubsystem(ctx, objLayer) diff --git a/cmd/test-utils_test.go b/cmd/test-utils_test.go index 4ab298998..5d30a3849 100644 --- a/cmd/test-utils_test.go +++ b/cmd/test-utils_test.go @@ -223,7 +223,7 @@ func initFSObjects(disk string, t *testing.T) (obj ObjectLayer) { newTestConfig(globalMinioDefaultRegion, obj) - newAllSubsystems() + initAllSubsystems() return obj } @@ -355,7 +355,7 @@ func initTestServerWithBackend(ctx context.Context, t TestErrHandler, testServer globalMinioPort = port globalMinioAddr = getEndpointsLocalAddr(testServer.Disks) - newAllSubsystems() + initAllSubsystems() globalEtcdClient = nil @@ -1474,7 +1474,7 @@ func newTestObjectLayer(ctx context.Context, endpointServerPools EndpointServerP return nil, err } - newAllSubsystems() + initAllSubsystems() return z, nil } @@ -1518,7 +1518,7 @@ func removeDiskN(disks []string, n int) { // initialies the root and returns its path. // return credentials. func initAPIHandlerTest(ctx context.Context, obj ObjectLayer, endpoints []string) (string, http.Handler, error) { - newAllSubsystems() + initAllSubsystems() initConfigSubsystem(ctx, obj) @@ -1799,7 +1799,7 @@ func ExecObjectLayerTest(t TestErrHandler, objTest objTestType) { } setObjectLayer(objLayer) - newAllSubsystems() + initAllSubsystems() // initialize the server and obtain the credentials and root. // credentials are necessary to sign the HTTP request. @@ -1825,7 +1825,7 @@ func ExecObjectLayerTest(t TestErrHandler, objTest objTestType) { localMetacacheMgr.deleteAll() } - newAllSubsystems() + initAllSubsystems() objLayer, fsDirs, err := prepareErasureSets32(ctx) if err != nil { t.Fatalf("Initialization of object layer failed for Erasure setup: %s", err)